simonwep / selection

✨ Viselect - A high performance and lightweight library to add a visual way of selecting elements, just like on your Desktop. Zero dependencies, super small. Support for major frameworks!
https://simonwep.github.io/selection
MIT License
2.49k stars 145 forks source link

Custom scrolling element option #153

Open Alexloof opened 2 years ago

Alexloof commented 2 years ago

Is your feature request related to a problem? Please describe.

I would like to enable the "drag-selecting while scrolling" behaviour in my codebase. However, I have issues because my setup is very complex and includes a lot of components. Therefore, my scrolling element can not be the SelectionArea, and by reading in another issue this must be the case to make this behaviour work.

Describe the solution you'd like

The perfect solution for my use-case would be, that I can pass a custom Element as the "scrolling element" to VanillaSelectionArea config.

Alexloof commented 2 years ago

@Simonwep Do you have an update to this issue? I really need the "drag-selecting while scrolling" feature 🥇

simonwep commented 2 years ago

Hi! Sorry for coming back to this so late, I'll take a look at it this weekend! :)

Alexloof commented 2 years ago

No worries, now I actually got it working. The gotcha was that the className/element provided in boundries must be the scroll element. So if they are not the same it won't work. So for me, this issue is actually solved even though it wasn't super clear how to do it. However, now I have another issue/feature request. It might be a bigger one and more complicated so I will open a new ticket if that is fine?

simonwep commented 2 years ago

Hey @Alexloof - that'd be cool, I'll leave this one open and, depending on my findings, update the documentation if necessary :) Just make sure to reproduce it on something like codesandbox ^^

felixfeng33 commented 2 months ago

Hi, first of all, thank you very much for maintaining an excellent library.But now I encounter this issue. After setting the boundaries, the scrolling speed seems to have slowed down, and occasionally it becomes unresponsive.In this minimal example, it doesn’t seem easy to reproduce the scrolling issue, but the noticeable slowdown in speed can be felt.In Plate.js, the stuttering is noticeably apparent. codesandbox https://codesandbox.io/p/live/4e8ad628-4916-4f54-8bec-4f29346f14b4

felixfeng33 commented 3 weeks ago

@Alexloof Hi, After setting the boundaries Did you encounter any issues with the scrolling speed?