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

Fix focus behavior when ancestor is focusable #1127

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

bendemboski
Copy link
Contributor

When clicking/double-clicking on an un-focusable element with a focusable ancestor, the focus helper was not noticing that there was a focusable ancestor, and blurring the active element without focusing the focusable ancestor (or leaving focus alone of the focusable ancestor was already focused).

When clicking/double-clicking on an un-focusable element with a focusable ancestor, the __focus__ helper was not noticing that there was a focusable ancestor, and blurring the active element without focusing the focusable ancestor (or leaving focus alone of the focusable ancestor was already focused).
@bendemboski
Copy link
Contributor Author

This fixes one of the cases that #1033 broke.

My use case is clicking on an un-focusable element inside a focused contenteditable to perform actions using a different selection model (CKEditor's, which is different from the browser's focus model). Before #1033, doing so would do the right thing for the wrong reason (keep the contenteditable focused because we weren't blurring the active element when clicking an un-focusable element). After #1033 it started doing the wrong thing (blurring the contenteditable), but with this change it will do the right thing for the right reason, as well as supporting other focus scenarios such as clicking on spans inside of anchors, etc.

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this!

@rwjblue rwjblue added the bug label Oct 6, 2021
@rwjblue rwjblue merged commit 8fd6f34 into emberjs:master Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants