You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At Slack we're using the focus-ring library to style focus when the user navigates using the keyboard. The focus-ring library binds focus and blur event listeners used to add and remove a focus-ring class from the event target. Unfortunately, once you navigate into a Quill editor using the Tab key, you cannot navigate out by pressing Tab as a result of Quill re-focusing the editor in response to DOM mutation. (Specifically, Quill currently calls setNativeRange() in response to a mutation event.)
Here's the breakdown of the the sequence of events:
The user presses Tab to navigate out of a Quill editor, and in response to the blur event the focus-ring library removes the focus-ring class from the editor's contenteditable <div>.
At Slack we're using the focus-ring library to style focus when the user navigates using the keyboard. The focus-ring library binds
focus
andblur
event listeners used to add and remove afocus-ring
class from the event target. Unfortunately, once you navigate into a Quill editor using the Tab key, you cannot navigate out by pressing Tab as a result of Quill re-focusing the editor in response to DOM mutation. (Specifically, Quill currently callssetNativeRange()
in response to a mutation event.)Here's the breakdown of the the sequence of events:
blur
event the focus-ring library removes thefocus-ring
class from the editor's contenteditable<div>
.Parchment
'sScrollBlot
is called, which in turn callsupdate()
update()
emits a 'scroll-before-update' event.setNativeRange()
method.setNativeRange()
focuses the editor if it doesn't already have focusSteps for Reproduction
Expected behavior:
You should be able to press Tab to exit the editor.
Actual behavior:
Re-focusing the editor in response to the DOM mutation (class name removal) prevents the user from navigating out via the Tab key.
Platforms:
Chrome on Mac and Windows (and likely Linux, but wasn't able to test on Linux)
Version:
1.2.3
The text was updated successfully, but these errors were encountered: