Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registered CustomKey listeners are lost on reattach #92

Open
javier-godoy opened this issue Jul 25, 2024 · 0 comments
Open

Registered CustomKey listeners are lost on reattach #92

javier-godoy opened this issue Jul 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@javier-godoy
Copy link
Member

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);
}}
  1. Navigate to the view
  2. Write stuff and check that history works
  3. Press F5
  4. Check that history does not work

Add-on Version

3.0.0

Vaadin Version

24.4.6

Additional information

No response

@javier-godoy javier-godoy added the bug Something isn't working label Jul 25, 2024
@github-project-automation github-project-automation bot moved this to Inbox (needs triage) in Flowing Code Addons Jul 25, 2024
@javier-godoy javier-godoy moved this from Inbox (needs triage) to To Do in Flowing Code Addons Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To Do
Development

No branches or pull requests

1 participant