Settings: Fix jumping scroll during swipe
This commit is contained in:
parent
00e3beebfc
commit
be3f53411a
@ -448,6 +448,7 @@ function LeftColumn({
|
||||
|
||||
return captureControlledSwipe(ref.current!, {
|
||||
excludedClosestSelector: '.ProfileInfo, .color-picker, .hue-picker',
|
||||
selectorToPreventScroll: '#Settings .custom-scroll',
|
||||
onSwipeRightStart: handleReset,
|
||||
onCancel: () => {
|
||||
setContent(LeftColumnContent.Settings);
|
||||
|
||||
@ -18,6 +18,7 @@ let onRelease: ((onCancel: NoneToVoidFunction) => void) | undefined;
|
||||
export function captureControlledSwipe(
|
||||
element: HTMLElement, options: {
|
||||
excludedClosestSelector?: string;
|
||||
selectorToPreventScroll?: string;
|
||||
onSwipeLeftStart?: NoneToVoidFunction;
|
||||
onSwipeRightStart?: NoneToVoidFunction;
|
||||
onCancel: NoneToVoidFunction;
|
||||
@ -25,6 +26,7 @@ export function captureControlledSwipe(
|
||||
) {
|
||||
return captureEvents(element, {
|
||||
excludedClosestSelector: options.excludedClosestSelector,
|
||||
selectorToPreventScroll: options.selectorToPreventScroll,
|
||||
swipeThreshold: 10,
|
||||
|
||||
onSwipe(e, direction, offsets) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user