Skip to content

Commit be1703a

Browse files
authoredMay 23, 2022
fix: reset _preventScroll when setting up scroll prevention to avoid side effects (#498)
1 parent 978b05b commit be1703a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

‎.changeset/good-games-stare.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@use-gesture/core': patch
3+
---
4+
5+
fix: reset \_preventScroll when setting up scroll prevention to avoid side effects

‎packages/core/src/engines/DragEngine.ts

+2
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ export class DragEngine extends CoordinatesEngine<'drag'> {
303303
}
304304

305305
setupScrollPrevention(event: PointerEvent) {
306+
// fixes https://github.com/pmndrs/use-gesture/issues/497
307+
this.state._preventScroll = false
306308
persistEvent(event)
307309
// we add window listeners that will prevent the scroll when the user has started dragging
308310
const remove = this.eventStore.add(this.sharedConfig.window, 'touch', 'change', this.preventScroll.bind(this), {

0 commit comments

Comments
 (0)