Prevents swiping when zoomed in (#37323)
This commit is contained in:
parent
a0ce77673c
commit
4bae3da85c
@ -114,6 +114,11 @@ export const MediaModal: FC<MediaModalProps> = forwardRef<
|
|||||||
|
|
||||||
const bind = useDrag(
|
const bind = useDrag(
|
||||||
({ active, movement: [mx], direction: [xDir], cancel }) => {
|
({ active, movement: [mx], direction: [xDir], cancel }) => {
|
||||||
|
// Disable swipe when zoomed in.
|
||||||
|
if (zoomedIn) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If dragging and swipe distance is enough, change the index.
|
// If dragging and swipe distance is enough, change the index.
|
||||||
if (
|
if (
|
||||||
active &&
|
active &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user