TextArea make AutoFocus attribute work
Is your feature request related to a problem?
I would like to have focus on a Textbox the moment it is rendered. I usually use the autoFocus attribute for that, but it does not work for the UI5 Textbox.
Describe the solution you'd like
I would like to have an easy way to move focus to the Textbox on render.
Describe alternatives you've considered
It would also be possible to add a reference to the textarea using useRef and utilize that to switch focus through useEffect.
Additional Context
the attribute autoFocus={true} should be working on TextArea like described in https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
Organization
No response
Declaration
- [X] I’m not disclosing any internal or sensitive information.
Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.
Hello @SAP/ui5-webcomponents-topic-core ,
The reporter would like to focus the TextArea with its initial rendering by using the autofocus attribute.
Currently this is not possible with any of the components, even if it has the shadowRootOptions: { delegatesFocus: true }, configuration.
It seems like it's shadow root limitation, but I would like you to have the final word.
Regards, Plamen Ivanov
Hi @dobrinyonkov , @MapTo0 , @TeodorTaushanov , @tsanislavgatev,
Seems like property that should be implemented by each component separately at least for some input like components because if the autofocus attribute is set to the custom element that has delegateFocus: true in the initial rendering focusable DOM reference might not exists.
Lets discuss it offline.
Any news regarding this issue?