Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Already selected items became deselected on page scrolling #206

Closed
DarknessInMe opened this issue Aug 16, 2023 · 3 comments
Closed

Already selected items became deselected on page scrolling #206

DarknessInMe opened this issue Aug 16, 2023 · 3 comments
Assignees
Labels
browser quirk Browser / devices specific issue unconfirmed Problem is not confirmed yet

Comments

@DarknessInMe
Copy link

What is the problem?

If you start selecting and scroll down by mouse wheel, elements on the top getting deselected

2023-08-16.12.59.21.mov

What is the current behavior?

Already selected items became deselected

Please provide the steps to reproduce and create a CodeSandbox.

  1. Select some items
  2. Don't stop selection and scroll down
  3. Stop selection and scroll back to the top
  4. Observe your previously selected items

What is the expected behavior?

Already selected items must be kept as selected

Your environment:

Toolset (e.g. webpack, vite, vue-cli...): webpack ^5.76.0 (Also reproducible on demos)
Version (@viselect/vanilla). ^3.2.4. Also reproducible on latest version and on demos
Browser:  Safari 16.5
OS:  macOS Ventura 13.4

Also, I want to admit, that I've spent some time to figure out solution for this problem. Reason why it happens is this line. Library expects that wheel event will be bubbled to the document. And it works fine for Chrome, but not for Safari. Seems like Safari doesn't bubble up this event by default. Simplest solution for my project was adding additional wheel event listener for my scrollable block.
scrollableBlock.addEventListener('wheel', () => {})
In that case wheel event will be bubbled up to document and everything is ok.

@DarknessInMe DarknessInMe added the unconfirmed Problem is not confirmed yet label Aug 16, 2023
@simonwep simonwep added the browser quirk Browser / devices specific issue label Aug 21, 2023
@simonwep
Copy link
Owner

simonwep commented Sep 2, 2023

Thank you for looking into it! I don't have a mouse with me right now, I'll take a look at it in the upcoming week :)

@igor-sysoev
Copy link

I'm experiencing the same issue on 1.7.1 version. I tried updating to latest, which has the web-kit fix, but to no avail!

@unikitty37
Copy link

This also occurs for me when dragging at https://simonwep.github.io/selection/ — I'm assuming the fix is already deployed there, though.

Browser: Vivaldi 6.2.3105.54 (Stable channel) (arm64)
OS: macOS 13.5.2 (22G91)
Platform: Mac Studio with Apple Magic Trackpad 2

Screen.Recording.2023-10-06.at.13.41.03.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser quirk Browser / devices specific issue unconfirmed Problem is not confirmed yet
Projects
None yet
Development

No branches or pull requests

4 participants