material-components / material-web

Material Design Web Components
https://material-web.dev
Apache License 2.0
9.42k stars 902 forks source link

[mwc-textfield] - missing autofocus attribute support #1916

Open yinonov opened 4 years ago

yinonov commented 4 years ago

Is your feature request related to a problem? Please describe. autofocus property isn't provided in textfield. making it impossible for consumers to natively focus on textfield's input on load of page

Describe the solution you'd like Forward autofocus property to actual shadowed input

Describe alternatives you've considered look up the shadowed input programmatically and call its focus method

Additional context autofocus attribute is quite a common attribute and should be prioritise for a11y reasons

dfreedm commented 4 years ago

Thanks for the report! Looks like autofocus attribute on the input should just work (Example: https://glitch.com/edit/#!/humane-bramble-bunny)

DannyMoerkerke commented 3 years ago

Thanks for the report! Looks like autofocus attribute on the input should just work (Example: https://glitch.com/edit/#!/humane-bramble-bunny)

Isn't the question here how to autofocus mwc-textfield? The Glitch demo merely puts autofocus on a native input element.

SaadBazaz commented 4 months ago

Needed!