pl-fe: another partial fix

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-02-05 21:26:01 +01:00
parent 4203d5ad75
commit baee6209fc

View File

@ -127,12 +127,22 @@ const MediaModal: React.FC<MediaModalProps & BaseModalProps> = (props) => {
};
const bind = useDrag(
({ active, movement: [mx], direction: [xDir], cancel }) => {
({ active, movement: [mx], direction: [xDir], cancel, event }) => {
// Disable swipe when zoomed in.
if (zoomedIn) {
return;
}
// Disable swipe when interacting with video/audio controls or other interactive elements
const target = event?.target as HTMLElement | null;
if (target) {
const interactiveParent = target.closest('.video-player__controls');
if (interactiveParent) {
cancel();
return;
}
}
// If dragging and swipe distance is enough, change the index.
if (
active &&