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

Merged
merged 5 commits into from
Aug 18, 2024

Conversation

KittyGiraudel
Copy link
Owner

@KittyGiraudel KittyGiraudel commented Oct 3, 2023

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. Extracted in Account for Shadow DOM when dealing with nested dialogs #706.
  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.

@KittyGiraudel KittyGiraudel merged commit 18e1f31 into main Aug 18, 2024
3 checks passed
@KittyGiraudel KittyGiraudel deleted the web-components branch August 18, 2024 09:53
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.

2 participants