sa-si-dev / virtual-select

A javascript plugin for dropdown with virtual scroll
https://sa-si-dev.github.io/virtual-select
MIT License
243 stars 57 forks source link

Scrolling gets stuck in Safari when multiple select has options selected #331

Open fausto1389 opened 4 months ago

fausto1389 commented 4 months ago

When there is a multiple type select that already has selected options; scrolling in Safari, the option with focus generates a stop that prevents further scrolling in the drop-down list. I attach a video with the evidence.

https://github.com/sa-si-dev/virtual-select/assets/60934488/d1293f9a-bc78-4fc7-9c7b-700e441550f0

kjmitch commented 4 months ago

I'm seeing behavior similar to this in Firefox 125.0b9 and Chrome 124.0.6367.92 on Windows 10. I'm not sure if it's the same situation; Once I make a single selection, I can scroll down manually using the thumb in the scrollbar, but then when I hover over the menu items again it scrolls up automatically.

The scrolling up seems to respond faster to my cursor hovering over higher items on the list, as if there's a trigger I'm activating on the menu's top half. The menus I'm seeing this on have option groups one level deep, multiple select enabled, and the focusSelectedOptionOnOpen property set to false.

I also have event listeners attached to some of the Virtual Select elements that are doing this; these listeners' callbacks affect other elements on the page when the change event is dispatched, based on the selected value(s) in the VS menu. I had wondered if maybe the VS element is losing focus and whether that could cause the scrolling to fail on the opened drop-down box.

kjmitch commented 3 months ago

I just downgraded this library to make sure the issue I was dealing with isn't present in my webapp. I narrowed it down and found that my issue seems to have been introduced in version 1.0.41, so rolling my CDN import back to 1.0.40 removed the issue for me. Not sure if that would remove OP's issue as well, though my issue did include the problems they mentioned.