Page refresh on enter key

Hi, I would like to ask some support from you. We have a TextField used as an input for filtering in a Grid. Filtering happens on ValueChangeListener. I have users where a complete browser page refresh occurs, when they press enter within the TextField. On my devices only the Focus changes from inner to outer element in the TextField. Any idea, how this behaviour of page reload could happen?

In general I don’t want my users to use enter key in the filter TextField as the grid is updated during typing. Is it possible to disable Enter key events here?

That sounds strange and I never heard of this issue. Is there anything else than filtering in the value change listener? Maybe an exception is thrown?

@adaptable-uakari Thanks for your answer. Today, we installed an IDE on the colleagues machine, so that we can run the app locally. Tommorrow we can find out, if it is her’s browser problem. The strange thing is, that it happens on her machine both with Chrome and Safari. I will answer when I can see the logs.

This part also confuses me:
“On my devices only the Focus changes from inner to outer element in the TextField.”

Nothing like that should happen either. Unless you programmatically move focus elsewhere on Enter, it should stay in the field. And the field does not have inner and outer focusable parts.

Thank you for your support. We have found the issue. There was a component only visible to a specific user group (admins to impersonate to users) with a shortcut set to enter. As the documentation states the shortcut has global scope:


@useful-whale I have created a video for the focus issue. At the end of the video I am pressing the enter key multiple times:

ah, right, the TF is in a Grid cell, so focus moves between the cell and the field. That is expected.

As for the global scope, perhaps you already figured it out but you can limit the scope with .listenOn

@useful-whale Thank you. No, I didn’t know the .listonOn possibility. I have moved the listener now to the correct component:

emailTextField.addKeyUpListener(Key.ENTER, event -> ...);