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

Remove PublicationMenuComponent render modifiers #8264

Merged

Conversation

michaelchadwick
Copy link
Contributor

@michaelchadwick michaelchadwick marked this pull request as ready for review December 13, 2024 17:02
@stopfstedt stopfstedt removed the request for review from jrjohnson December 13, 2024 19:17
menuElement.querySelector('button:first-of-type').focus();
focusFirstLink = task(async () => {
await timeout(1);
document.querySelector('.publication-menu .menu button:first-of-type').focus();
Copy link
Member

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();
Copy link
Member

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.

Copy link
Member

@stopfstedt stopfstedt left a 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.

@dartajax dartajax added the run ui tests Run the expensive UI tests label Dec 16, 2024
@dartajax dartajax merged commit 7e0cf47 into ilios:master Dec 16, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run ui tests Run the expensive UI tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants