dnd-kit icon indicating copy to clipboard operation
dnd-kit copied to clipboard

Mouse wheel no longer works while dragging

Open camstar915 opened this issue 1 year ago • 5 comments

Hello, I'm not sure what code samples I could put here that would be helpful.. but my mouse scroll wheel works well when I'm in the example stories provided by dnd-kit, but it doesn't work in my own project.

Is there something that turns this functionality on/off ?

camstar915 avatar Nov 02 '24 04:11 camstar915

Hello :) I faced the same problem. I think you have an another scrollable block (not a common document scroll) whereas in the stories example this is a common document scroll.

For example, just try use this example with scrollable block inside document area - https://master--5fc05e08a4a65d0021ae0bf2.chromatic.com/?path=/docs/presets-sortable-virtualized--basic-setup

Sorry for my bad English )

AlexandrMers avatar Nov 20 '24 12:11 AlexandrMers

It's ok! Thanks! Did you find a way to get scrolling to work when not on the main document scroll?

camstar915 avatar Nov 20 '24 20:11 camstar915

Unfortunately no :( I noticed that it works when you try to move mouse and scroll wheel at the same time.

I just turned on an automatic scroll when dragging block in the DNDContext

If you'll find some way to solve it please write about it here

AlexandrMers avatar Nov 21 '24 05:11 AlexandrMers

@AlexandrMers Wow thank you for this man, you're right that must be it.

Been pulling my hair trying to figure out a way to fix this.

Does anyone have any idea on how to fix this or work around it?

cc: @camstar915

maddada avatar Jul 08 '25 18:07 maddada

I think this issue is related to this one https://github.com/clauderic/dnd-kit/issues/1364, which already has a solution

It has to do with pointer-events when you press on the DragOverlay

Just disable pointer-events on DragOverlay, and it should be good

doanhtu07 avatar Jul 10 '25 06:07 doanhtu07