Skip to content

Conversation

@codyrancher
Copy link
Member

@codyrancher codyrancher commented Oct 30, 2025

Summary

Fixes #15520

Technical notes summary

We would scroll the menu item into view when the menu item received focus. This in turn would prevent the action from getting triggered. We now prevent the focusin event from occurring the user clicks. This allows the focus event to still fire during keyboard navigation.

Areas or cases that should be tested

Anywhere that there's a dropdown menu which has a scrollbar.

Areas which could experience regressions

Keyboard navigation in the dropdown menu.

Screenshot/Video

The cluster page example isn't as obvious because I only had one event but you can tell it's working since the action menu closes on click.

action-menu-click.mp4

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

@click.stop="handleClick"
@keydown.enter.space="handleActivate"
@keydown.up.down.prevent.stop="handleKeydown"
@mousedown.prevent="() => {/*We use this to prevent clicks from triggering the @focusin below. When we scroll on a click it prevents the action from occurring on the first click.*/}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a better way to leave a comment right next to the @focusin I'd be happy to switch.

@codyrancher codyrancher marked this pull request as ready for review October 30, 2025 19:05
@codyrancher codyrancher merged commit d7f7017 into rancher:master Oct 30, 2025
92 of 97 checks passed
@codyrancher codyrancher deleted the action-menu-click branch October 30, 2025 19:46
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

Successfully merging this pull request may close these issues.

First click on item in scrollable drop down menu fails

2 participants