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

Track last event for when in Shadow DOM #2126

Closed
wants to merge 3 commits into from
Closed

Track last event for when in Shadow DOM #2126

wants to merge 3 commits into from

Conversation

trueadm
Copy link
Collaborator

@trueadm trueadm commented May 10, 2022

Fixes #2119. In the Shadow DOM, window.event returns undefined. In this case, we need to use the last known event that the Lexical event system knows of in order to get some heuristic working. I'm unsure of if this will work in all cases, so leaving as as draft for now.

@vercel
Copy link

vercel bot commented May 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview May 10, 2022 at 1:07PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview May 10, 2022 at 1:07PM (UTC)

@yuzhouu
Copy link

yuzhouu commented May 10, 2022

window.event is marked as Deprecated, why not just replace it?

@trueadm
Copy link
Collaborator Author

trueadm commented May 10, 2022

@yuzhouu Replace it with what? window.event is actually super valuable, as there are plenty of times when you're in an event – but not within an event listener. Such as during mutation observers or a microtask. There are plenty of things marked as deprecated that we still need to support, such as execCommand too. :/

@trueadm
Copy link
Collaborator Author

trueadm commented May 11, 2022

Holding off on this, as seems there's far more work to get Shadow DOM support working with Selection.

@trueadm trueadm deleted the active-event branch May 18, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Binding to webcomponent shadow root fails
3 participants