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

Slotted elements which appear within a dialog due to slots but are declared outside of the dialog cannot get focus in Firefox and Safari #217

Open
carmour24 opened this issue Feb 27, 2021 · 2 comments

Comments

@carmour24
Copy link

In Firefox and Safari, an element slotted into a dialog within a web component will not get focus events. The call to findNearestDialog from safeBlur_ returns null in this instance as the declaration of the slotted element is outside the dialog though the element itself appears within it.

This issue is similar to #189 in that findNearestDialog isn't able to properly traverse the DOM tree in this instance and a fix is to add an extra clause in here to navigate to the assignedSlot (where the element is inserted into the dialog).

I've created a repo at https://github.com/carmour24/slotted-element-modal-issue reproducing the issue and included a branch showcasing a fix I've made in a fork of dialog-polyfill which I'd be happy to submit a PR for.

@samthor
Copy link
Contributor

samthor commented Mar 3, 2021

I'm happy to accept PRs.

@nasim-git
Copy link

I have this bug with polyfill in safari and slotted content. @carmour24 can you submit your PR?

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

No branches or pull requests

3 participants