Missing selection-change event when editor loses focus by clicking a button
See original GitHub issueSteps for Reproduction
- Visit https://codepen.io/medihack/pen/GBRYXw
- Select the editor to focus it. A
selection-change
event is correctly fired (see console). - Click the “Click me” button below the editor. No selection event is fired.
Expected behavior:
A selection-change
event should be fired with a null
range when the editor loses focus when clicking a button somewhere else.
Actual behavior:
The selection-change
event is not fired when the editor loses focus by clicking on a button.
Platforms:
Chrome (67.0.3396.99) on Windows 10.
Version:
Quill 1.3.6
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
Javascript rich text editor, contenteditable area loses focus ...
Well the focus moves to the button so you need to cancel the click action so the focus is not lost in the...
Read more >Grid Events - JavaScript Data Grid
This is a list of the events that the grid raises. ... Value has changed after editing (this event will not fire if...
Read more >First button click is not executed in editor when window focus ...
First button click is not executed in editor when window focus is lost · 1. Open the user's attached project · 2. Open...
Read more >End SfDatagrid edition when losing focus - WPF - Syncfusion
Thank you for using Syncfusion products. In TabControl.SelectionChanged event, you can end edit the current cell of SfDataGrid when swithching ...
Read more >Blazor ComboBox - Events - Documentation - Telerik
The OnBlur event fires when the component loses focus. Handle the OnBlur event. Edit Preview. @* ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Problem: loses selection when i click some toolbar menus, especially the dropdown one Solution: Trapping the
mousedown
ontoolbar
container and callinge.preventDefault()
We needed to know when the
selection-change
range changes tonull
so that we can send it off via WebSocket to sync cursors.The documentation (https://quilljs.com/docs/api/#selection-change shown in the screenshot below) says that you can use this to be notified of selection loss but the event is never triggered when the editor is blurred.
To fix our problem we just got a hold of the editor element and listened for blur like so: