Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Button focusing??
Can I disable button focus when button is clicked.
I would like to textfield, that is focused, keeps focus.
In Delphi, i had a button called SpeedButton that cannot get focus
Can this be done with Vaadin??
Off the top of my head I can't think of any simple way to keep the focus from switching, but you can of course set the focus back to the TextField in the Button's ClickListener.
Anna Koskinen: Off the top of my head I can't think of any simple way to keep the focus from switching, but you can of course set the focus back to the TextField in the Button's ClickListener.
I am already doing this, but is not pretty.
The focus is jumping on button and back again.
To accomplish this, you would need to add "event.preventDefault()" to the mousedown event on the button. This is enough to prevent the focus from leaving a previously focused element, but still allows the button to receive the click event.
There’s actually an enhancement ticket about this in Trac: https://dev.vaadin.com/ticket/5072