primereact icon indicating copy to clipboard operation
primereact copied to clipboard

fix(MultiSelect): #8102 - keyboard navigation and scrolling from wrapper

Open Luko248 opened this issue 3 months ago • 1 comments

Description

Fixes #8102

This PR improves keyboard navigation and scrolling behavior in MultiSelect component:

  • Prevent page scroll on Space when wrapper has focus
  • ArrowUp/Down enter and move options from wrapper
  • Auto-scroll wrapper to keep focused option visible (both directions)
  • Escape closes and returns focus to trigger
  • Add onKeyDown+tabIndex to wrapper/virtual list; data-p-index on items

Changes

  • Enhanced keyboard navigation from wrapper element
  • Improved auto-scrolling to keep focused options visible
  • Better focus management when closing with Escape key
  • Added necessary attributes for accessibility (tabIndex, data-p-index)

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)

Testing

Please test keyboard navigation in MultiSelect component:

  1. Open MultiSelect panel
  2. Use Arrow keys to navigate through options
  3. Press Space to select/deselect
  4. Verify auto-scrolling works correctly
  5. Press Escape to close and verify focus returns to trigger

Luko248 avatar Oct 23 '25 13:10 Luko248

set to PrimeTek to review.

melloware avatar Oct 24 '25 14:10 melloware