primereact
primereact copied to clipboard
ListBox: The options list is being scrolled unexpectedly
Describe the bug
When you select some option, and then use the mouse wheel to scroll down or up, and then select another option, the list is being scrolled unexpectedly. Sometimes the clicked option is not selected at all (see option "Name 21" in the GIF below).
Reproducer
https://stackblitz.com/edit/tfiy9yla?file=src%2FApp.jsx
System Information
System:
OS: Windows 11 10.0.26100
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 3.08 GB / 23.70 GB
Binaries:
Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
bun: 1.2.18 - ~\.bun\bin\bun.EXE
Browsers:
Edge: Chromium (139.0.3405.111)
Internet Explorer: 11.0.26100.1882
npmPackages:
primereact: ^10.9.7 => 10.9.7
react: 19.1.0 => 19.1.0
Steps to reproduce the behavior
- Go to https://stackblitz.com/edit/tfiy9yla?file=src%2FApp.jsx
- Select some option
- Scroll the list and try to select another option immediately
Expected behavior
- The list stays in the position the user scrolled to.
- When the user selects a new option, it's not scrolling anywhere, but selects the option, and stays in the current scroll position.
Additional note: it's very easy to reproduce when you don't move the cursor but just: scroll, click, scroll, click