Describe the bug
A custom key listener is two-fold: there is a CustomKey DOM-event listener, and a client-side registration that filters which keys dispatch an event.
|
Registration r = getElement().addEventListener("CustomKey", listener).setFilter(filter); |
|
executeJs("this.registerCustomKeyListener($0)", json); |
The CustomKey event listener is added through Element API (so it is preserved after on reattach). However, the client side part (registerCustomKeyListener, etc) is added through JavaScript, and will be lost.
Expected behavior
Custom key listeners should after reattach.
Minimal reproducible example
@PreserveOnRefresh
public class ConsoleView extends Div {{
XTerm xterm = new XTerm();
TerminalHistory.extend(xterm);
add(xterm);
}}
- Navigate to the view
- Write stuff and check that history works
- Press F5
- Check that history does not work
Add-on Version
3.0.0
Vaadin Version
24.4.6
Additional information
No response