[WIP]: fix: global focus event listeners#9665
Closed
snowystinger wants to merge 2 commits intomainfrom
Closed
Conversation
Member
Author
|
Closing, this is meant as a starting point and is linked to from the ticket for further shadow dom work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes
Started from #9632
Realised we cannot only listen to focus events for certain managers at the global document/window level. Focus events don't bubble past their respective rootNode. So we would miss a lot of events possibly.
I've started some of the fixes, but this will need more work. I'm putting it in our backlog.
I've fixed "preventFocus".
useLandmark will need some attention, we'll need to add a
Map<Node, number>and any landmark we add, we'll need to add listeners to every rootNode of that landmark. We'll increase the refCount in the map at that time. We'll need to make sure that for focus events that go across these rootNode boundaries, that we handle that correctly, likely by calling stopPropagation at the lowest handler. That or we'll need to handle it at the lowest root which contains both the related (blurred) target and the new focused target. I'm not sure which yet.useViewportSize is an interesting one, it fixes an iOS bug and it doesn't have any information about a target element. We may be able to turn off the rule entirely for this file, but if so, we should include a code comment explaining why
DragManager will need updating, we'll need to move the setup of events until after this.updateValidDropTargets probably. This way we can make a list of all the rootNodes that we need to listen to as it will be any that contain the valid drop targets.
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: