Skip to content

Conversation

@codyrancher
Copy link
Member

@codyrancher codyrancher commented Jan 8, 2026

Summary

The parent container's @mousedown.prevent was blocking text selection in the filter input. Adding @mousedown.stop to the input prevents the event from bubbling up, allowing normal text selection behavior while preserving the dropdown's focus management.

Fixes #12658

Occurred changes and/or fixed issues

Users can now select text in the namespace filter input field using mouse interactions (double-click to select word, click-and-drag to select text).

Technical notes summary

This adds@mousedown.stop on the input, preventing them from bubbling up to the parent .ns-filter container where @mousedown.prevent would block text selection.

Important: This change preserves the focus behavior fix introduced in ad2c555 (PR #11762).

Areas or cases that should be tested

  • Use the mouse to highlight text in the namespace filter
  • Use the keyboard to highlight text in the namespace filter
  • Clicking outside the dropdown still closes it
  • Verify the focus behavior from Vue3: Namespace selector immediately deselects #11683 is still working (no unwanted focus when clicking to open/close)

Areas which could experience regressions

  • Namespace filter dropdown toggle behavior - The dropdown should still open/close correctly when clicking the main dropdown area
  • Focus management - The fix from Vue3: Namespace selector immediately deselects #11683 should remain intact; clicking the dropdown should not cause unwanted focus issues
  • Keyboard navigation - Tab/arrow key navigation within the namespace filter should remain unaffected

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

The parent container's @mousedown.prevent was blocking text selection
in the filter input. Adding @mousedown.stop to the input prevents the
event from bubbling up, allowing normal text selection behavior while
preserving the dropdown's focus management.

Fixes rancher#12658
@codyrancher codyrancher modified the milestones: v2.16.0, v2.14.0 Jan 8, 2026
@codyrancher codyrancher changed the title Fix text selection in namespace filter input () Fix text selection in namespace filter input Jan 8, 2026
@codyrancher codyrancher requested a review from aalves08 January 8, 2026 14:20
@codyrancher codyrancher marked this pull request as ready for review January 8, 2026 14:20
Copy link
Member

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

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

LGTM - The change looks safe and is an improvement with regards to previous efforts to provide more consistent behavior in the NamespaceFilter.

@codyrancher codyrancher merged commit 3aa0b92 into rancher:master Jan 8, 2026
98 of 107 checks passed
@codyrancher codyrancher deleted the 12658 branch January 8, 2026 23:38
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.

Unselectable text field for namespace filter

2 participants