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!, {
|
return captureControlledSwipe(ref.current!, {
|
||||||
excludedClosestSelector: '.ProfileInfo, .color-picker, .hue-picker',
|
excludedClosestSelector: '.ProfileInfo, .color-picker, .hue-picker',
|
||||||
|
selectorToPreventScroll: '#Settings .custom-scroll',
|
||||||
onSwipeRightStart: handleReset,
|
onSwipeRightStart: handleReset,
|
||||||
onCancel: () => {
|
onCancel: () => {
|
||||||
setContent(LeftColumnContent.Settings);
|
setContent(LeftColumnContent.Settings);
|
||||||
|
|||||||
@ -18,6 +18,7 @@ let onRelease: ((onCancel: NoneToVoidFunction) => void) | undefined;
|
|||||||
export function captureControlledSwipe(
|
export function captureControlledSwipe(
|
||||||
element: HTMLElement, options: {
|
element: HTMLElement, options: {
|
||||||
excludedClosestSelector?: string;
|
excludedClosestSelector?: string;
|
||||||
|
selectorToPreventScroll?: string;
|
||||||
onSwipeLeftStart?: NoneToVoidFunction;
|
onSwipeLeftStart?: NoneToVoidFunction;
|
||||||
onSwipeRightStart?: NoneToVoidFunction;
|
onSwipeRightStart?: NoneToVoidFunction;
|
||||||
onCancel: NoneToVoidFunction;
|
onCancel: NoneToVoidFunction;
|
||||||
@ -25,6 +26,7 @@ export function captureControlledSwipe(
|
|||||||
) {
|
) {
|
||||||
return captureEvents(element, {
|
return captureEvents(element, {
|
||||||
excludedClosestSelector: options.excludedClosestSelector,
|
excludedClosestSelector: options.excludedClosestSelector,
|
||||||
|
selectorToPreventScroll: options.selectorToPreventScroll,
|
||||||
swipeThreshold: 10,
|
swipeThreshold: 10,
|
||||||
|
|
||||||
onSwipe(e, direction, offsets) {
|
onSwipe(e, direction, offsets) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user