primereact
primereact copied to clipboard
fix(MultiSelect): #8102 - keyboard navigation and scrolling from wrapper
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:
- Open MultiSelect panel
- Use Arrow keys to navigate through options
- Press Space to select/deselect
- Verify auto-scrolling works correctly
- Press Escape to close and verify focus returns to trigger
set to PrimeTek to review.