Replies: 1 comment 5 replies
-
Hi there! Thank you for bringing up this use case. Before I go ahead and implement a configuration option for this, I'd like you to confirm that this will provide the desired UX. The following patch completely disables pointer swipe navigation. You can save it under diff --git a/node_modules/yet-another-react-lightbox/dist/index.js b/node_modules/yet-another-react-lightbox/dist/index.js
index bfea5ea..72fec8a 100644
--- a/node_modules/yet-another-react-lightbox/dist/index.js
+++ b/node_modules/yet-another-react-lightbox/dist/index.js
@@ -1145,7 +1145,7 @@ function Controller({ children, ...props }) {
(offset) => pull(offset),
(offset) => pull(offset, true),
];
- usePointerSwipe(...swipeParams, closeOnPullUp, closeOnPullDown, ...pullParams);
+ //usePointerSwipe(...swipeParams, closeOnPullUp, closeOnPullDown, ...pullParams);
useWheelSwipe(swipeState, ...swipeParams);
const focusOnMount = useEventCallback(() => {
if (controller.focus && Please let me know if this addresses your use case. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have found myself in a scenario where I cannot use event.preventDefault and event.stopPropagation to disable drag navigation. The reason being, I am using yarl with a library called moveable where I am designing the div container of yarl to be moved around the page via the same (or events after) the drag event for yarl navigation. Trying to use the suggestion from #203 and #184 did not work because it disabled dragging on the moveable (library) mechanism. I even tried to wrap the image slides around a customer render where the interception of the events could be done at individual slide level, with no success.
So I thought for this to work, moveable container, being the outer component, can change to stop propagation properly after it does it what it wants to do, OR I can see if yarl can add a component-level feature that can disable drag navigation specified as a property or something, independent of rendered html elements.
I have attached a screengrab of my project where the two libraries working together. For now the dragging of the container also swipes the image in yarl, which is not desirable but also not terrible.
Screen.Recording.2025-03-25.at.1.04.41.PM.mov
By the way, this component is awesome. Thank you for what you do.
Beta Was this translation helpful? Give feedback.
All reactions