From 7a316785fad9f78ea9b2fdb1db6243633d3ee045 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 12 Apr 2023 15:53:41 -0700 Subject: [PATCH] sel: fix mobile multi-select Signed-off-by: Varun Patil --- src/components/SelectionManager.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 94cd1a8d..49d742dd 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -443,16 +443,17 @@ export default defineComponent({ /** Multi-select triggered by touchmove */ touchMoveSelect(touch: Touch, rowIdx: number) { // Which photo is the cursor over, if any - const elems = document.elementsFromPoint(touch.clientX, touch.clientY); - const photoComp: any = elems.find((e) => e.classList.contains("p-outer")); - let overPhoto: IPhoto = photoComp?.__vue__?.data; + const elem: any = document + .elementFromPoint(touch.clientX, touch.clientY) + ?.closest(".p-outer-super"); + let overPhoto: IPhoto = elem?.__vue__?.data; if (overPhoto && overPhoto.flag & this.c.FLAG_PLACEHOLDER) overPhoto = null; // Do multi-selection "till" overPhoto "from" anchor // This logic is completely different from the desktop because of the // existence of a definitive "anchor" element. We just need to find - // rverything between the anchor and the current photo + // everything between the anchor and the current photo if (overPhoto && this.prevOver !== overPhoto) { this.prevOver = overPhoto;