-
Notifications
You must be signed in to change notification settings - Fork 130
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
Using data-a11y-dialog-show with web components #712
Comments
Good morning Ella, and thank you for opening an issue! ✨ I was thinking about it on my way home last night, and I think the problem is that If I am right about this, then there are two ways to address it:
I think the 2nd version is better because it would work with however many nested web components, which is probably what we want (think a button inside of a card inside of a dialog or something). I need to spend a bit of time coming up with a reproducible test case first so that I can try fixing it. :) |
Addressed in #713. Do you want to venture a review, @ella-etch? :) |
Hey @KittyGiraudel, thanks for doing this so quickly! I've had a look through the code and also tested it out on our project - it all looks great, so I've left an approving review 💯 |
Solved in 8.1.1. Thanks! |
Hi!
I’ve just upgraded to v8.1.0 in our web component based design system and it’s fixed a problem we were having with shadow DOM and focus trapping, so thanks 😄
However, we now have an issue when trying to use
data-a11y-dialog-show
on a button custom element to trigger showing the modal (which is also a custom element). It looks like the change fromevent.target
toevent.composedPath()[0]
here means that we're now getting back the slot the button is in, rather than the button itself, so.show()
isn’t being called.I noticed there was a previous commit that accounted for a slot being returned and fell back to using
event.target
- I think reverting to that would fix the issue?The text was updated successfully, but these errors were encountered: