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

FocusTracker#isFocus gets out of sync when multiple blurs are followed by the focus #4956

Closed
oleq opened this issue May 23, 2017 · 0 comments · Fixed by ckeditor/ckeditor5-utils#160
Assignees
Labels
package:utils type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@oleq
Copy link
Member

oleq commented May 23, 2017

For the following structure registered in the FocusTracker (Parent and both Children):

Parent
   Child1 (focused)
   Child2

when the Child2 gets focused, blur events in DOM are fired both by the Child1 (which actually loses focus) and by the Parent (because FocusTracker adds listeners with useCapture).

ATM, only FocusTracker#_focus() clears the blur timeout, so in the situation above, only the second timeout is cleared and the first one is executed, which ends up with FocusTracker#isFocused sets to false despite the focus remaining within the FocusTracker's scope.

The solution is basically clearTimeout in FocusTracker#_blur.

@oleq oleq self-assigned this May 23, 2017
oleq referenced this issue in ckeditor/ckeditor5-utils May 23, 2017
oskarwrobel referenced this issue in ckeditor/ckeditor5-utils May 24, 2017
Fix: `FocusTracker` should remain in sync when multiple 'blur' events are followed by the 'focus'. Closes #159.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-utils Oct 9, 2019
@mlewand mlewand added this to the iteration 11 milestone Oct 9, 2019
@mlewand mlewand added status:confirmed type:bug This issue reports a buggy (incorrect) behavior. package:utils labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:utils type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
2 participants