yet-another-react-lightbox-lite 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -318,14 +318,14 @@ function useSensors() {
|
|
|
318
318
|
removePointer(event);
|
|
319
319
|
activePointers.current.push(event);
|
|
320
320
|
};
|
|
321
|
+
const shouldIgnoreEvent = (event) => ("pointerType" in event && event.pointerType === "mouse" && event.buttons > 1) ||
|
|
322
|
+
(event.target instanceof Element &&
|
|
323
|
+
(event.target.classList.contains(cssClass("button")) ||
|
|
324
|
+
event.target.classList.contains(cssClass("icon")) ||
|
|
325
|
+
Array.from(carouselRef.current?.parentElement?.querySelectorAll(`.${cssClass("toolbar")}, .${cssClass("selectable")}`) || []).find((element) => element.contains(event.target)) !== undefined));
|
|
321
326
|
const onPointerDown = (event) => {
|
|
322
|
-
if ((event
|
|
323
|
-
(event.target instanceof Element &&
|
|
324
|
-
(event.target.classList.contains(cssClass("button")) ||
|
|
325
|
-
event.target.classList.contains(cssClass("icon")) ||
|
|
326
|
-
Array.from(carouselRef.current?.parentElement?.querySelectorAll(`.${cssClass("toolbar")}, .${cssClass("selectable")}`) || []).find((element) => element.contains(event.target))))) {
|
|
327
|
+
if (shouldIgnoreEvent(event))
|
|
327
328
|
return;
|
|
328
|
-
}
|
|
329
329
|
addPointer(event);
|
|
330
330
|
const pointers = activePointers.current;
|
|
331
331
|
if (pointers.length === 2) {
|
|
@@ -427,6 +427,8 @@ function useSensors() {
|
|
|
427
427
|
}
|
|
428
428
|
};
|
|
429
429
|
const onDoubleClick = (event) => {
|
|
430
|
+
if (shouldIgnoreEvent(event))
|
|
431
|
+
return;
|
|
430
432
|
changeZoom(zoom < maxZoom ? scaleZoom(zoom, 2, 1) : 1, event);
|
|
431
433
|
};
|
|
432
434
|
return {
|