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 integration with web components not working properly #589

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

KittyGiraudel
Copy link
Owner

This should address #582. This PR contains essentially 2 fixes:

  1. The escape hatch for nested dialogs used document.activeElement and Element.prototype.closest() to detect whether the keypress should be ignore entirely. This did not play well with web components, and is fixed with the existing getActiveElement utility, and a new closest utility.
  2. The delegated click event listeners did not play well with web components. This is fixed by reading event.composedPath(), but also reads event.target in case the composed path target is a slot. Thank god for our existing tests, otherwise I would have 100% broken that case.

Honestly, web components has to be the worst thing that ever happened to HTML. What a goddamn mess, it‘s insane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants