Settings: Fix jumping scroll during swipe

This commit is contained in:
Alexander Zinchuk 2023-10-27 14:23:53 +02:00
parent 00e3beebfc
commit be3f53411a
2 changed files with 3 additions and 0 deletions

View File

@ -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);

View File

@ -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) {