Textfield autofocus & autocapitalize - Jmix version: 2.0.2

When I use autocapitalize=“CHARACTERS”, I expect something like this: type ‘test’ and on the textfield I see ‘TEST’ displayed
This does not seem to work like that. How can I make this work?

Suppose a screen with 2 textfields.
The first is setVisble(true) & setAutofocus(true)
The second is setVisible(false)
Enter a text in the first field + enter
Now I change the second to setVisble(true) & setAutofocus(true)
The second is now displayed on the screen, but without autofocus?
What am I missing?

Thanks!

Hi!

The autocapitalize attribute works differently.

This attribute doesn’t affect behavior when typing on a physical keyboard. Instead, it affects the behavior of other input mechanisms, such as virtual keyboards on mobile devices and voice input. It is only supported by Chrome and Safari: autocapitalize - HTML: HyperText Markup Language | MDN.

The same is written in Vaadin’s JavaDoc: com.vaadin.flow.component.textfield.HasAutocapitalize.
Thus, you will have to configure the uppercase conversion yourself.

The autofocus attribute works when the view is opened.
The component with autofocus grabs the focus ones opened.

So, only one component should have the autofocus attribute.
To focus a component, use the focus method in the view controller.

Regards,
Dmitriy