-
Notifications
You must be signed in to change notification settings - Fork 40
Autofocus fix #51
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
Autofocus fix #51
Conversation
If the dropdown itself is the `autofocus` field in the page, then `<details-menu>` fails to set focus to any other `autofocus` element in the popup when displaying it. Reason being that the selector matches first the `<summary>` and wrongly sets focus to it instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm, but would love to see a test :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good change to me. A test would be great to ensure it doesn't regress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me once we add a test ✨
Co-authored-by: Kristján Oddsson <koddsson@github.com>
If the dropdown itself is the
autofocus
field in the page, then<details-menu>
fails to set focus to any otherautofocus
element in the popup when displaying it.Reason being that the selector matches first the
<summary>
and wrongly sets focus to it instead of anyautofocus
element inside thedetails-menu
.An example was added to demonstrate the issue. It fails currently using the
@latest
version, but it's fixed when usingdist
.