Vaadin 14 ComboBox: React to user pressing ESC

Hi all,

I would appreciate if someone could give me pointers as to how to implement the following: User presses ESC while a ComboBox has focus. I would like to react to this, possibly by way of a key down listener or similar. But I can’t find how to do that.

Thank you and kind regards,
Matthias

Maybe this will help: https://vaadin.com/docs/v14/flow/components/tutorial-flow-shortcut.html

The link is very helpful, indeed. Thank you for that. I have not managed to capture ESC in combination with a ComboBox and assume this might be because the ESC is handled by the ComboBox already and I cannot add another listener for it? Maybe you could comment?

However, I found that for my purposes Ctrl-z is even more appropriate and I got this to work.

Thank you again.

Yep, turns out there’s a specific esc key handling in vaadin-combo-box: https://github.com/vaadin/vaadin-combo-box/blob/master/src/vaadin-combo-box-mixin.html#L389

Ok. Thank you very much for confirming.