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

handling focus and blur correctly #3110

Closed
Kasheftin opened this issue Jul 20, 2020 · 2 comments
Closed

handling focus and blur correctly #3110

Kasheftin opened this issue Jul 20, 2020 · 2 comments

Comments

@Kasheftin
Copy link

Steps for Reproduction

quill 1.3.6 is in use;

  1. Visit https://codepen.io/kasheftin/pen/BajvZdp;
  2. Focus, then click on the button below (outside of the editor);
  3. Notice that selection-change event was not triggered;
  4. Focus once again;
  5. Paste anything using CTRL+V;
  6. Notice that editor.root blur, editor.root focus, editor.root focusout, editor.root focusin, wrapper focusout, wrapper focusin events were called incorrectly;

That's related to:
#1397
#1951
#1680

but sadly using the work-around from one issue causes an issue in the other case and vise-versa. I'm stuck. I'm creating this issue to provide an example when nor selection-change, neither quill.root.addEventListener approach works.

We are using quill in the popup in real-time application with auto save. And we need some valid immediate trigger for blur event, that has to be triggered when the close-popup-button is pressed.

@bviala
Copy link

bviala commented Jul 22, 2020

Also duplicate of #2186

In your case, you could add an event listener on your button and do a save when it's clicked. Or replace the button by a div and selection-change will trigger.

@benbro
Copy link
Contributor

benbro commented Jan 30, 2024

Answered.

@benbro benbro closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants