Skip to content

Unintentional autofocus when using cdkTextareaAutosize  #11308

@hettiger

Description

@hettiger

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Textarea should not autofocus.

What is the current behavior?

Textarea get's autofocus when using cdkTextareaAutosize.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-rtrc1b

EDIT Please see #11308 (comment)

Simple debug in an iOS Simulator or on a real device using Mobile Safari.
Add / Remove the cdkTextareaAutosize Directive, then reload to reproduce.

What is the use-case or motivation for changing an existing behavior?

Using pristine is no longer really an option because cdkTextareaAutosize breaks this for Mobile Safari. While the textarea is gaining autofocus the virtual keyboard does not pop up even thought there's visual feedback that the textarea is having focus. It's really a weird user experience and should get fixed.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

  • Angular: 6.0.0
  • Material: 6.0.1
  • OS: iOS 11.3.1
  • TypeScript: ? (Stackblitz)
  • Browsers: Mobile Safari

Is there anything else we should know?

I've attached screenshots of the expected behavior and the actual behavior.

Expected Behavior Actual Behavior
simulator screen shot - iphone x - 2018-05-13 at 19 43 54 simulator screen shot - iphone x - 2018-05-13 at 19 44 06

Metadata

Metadata

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions