Key.ENTER problem

I’ve a Form (vaadin 24.8) in wich I want use Key.ENTER ato activate one operation. It seems to work but the content of the field where I press the key is not visible and then the operation fails.
EAGER is not an option because of many change listener I’ve.
Tks

Can you post a code snippet how you bind the ENTER key?

AddClickShortcut(xpCommand.getShortcut()); where xpCommand is a button.

You can do this:

Shortcuts.addShortcutListener(this, this::save, Key.ENTER)
        .setResetFocusOnActiveElement(true);

Then the text field will lose focus when you press the ENTER key.