Open Nils-Schiwek opened 1 month ago
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
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