-
Notifications
You must be signed in to change notification settings - Fork 27
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
Remove PublicationMenuComponent render modifiers #8264
Remove PublicationMenuComponent render modifiers #8264
Conversation
menuElement.querySelector('button:first-of-type').focus(); | ||
focusFirstLink = task(async () => { | ||
await timeout(1); | ||
document.querySelector('.publication-menu .menu button:first-of-type').focus(); |
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 works since there's only ever one menu open at the same time.
however, querying from the doc root is brittle.
i'm suggesting bringing the menu element back as input argument, then making the DOM query from that element instead.
would require identifying the menu element from the event target in the click handler -for example, if the clicked element is nested within the menu ("menu item"), you'll have to traverse the DOM tree up from it.
menuElement.querySelector('button:first-of-type').focus(); | ||
focusFirstLink = task(async () => { | ||
await timeout(1); | ||
document.querySelector('.publication-menu .menu button:first-of-type').focus(); |
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.
please see my comment about the course-variant of this component.
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.
click tested and reviewed. LGTM.
Refs ilios/ilios#5374