From 5e36dd3aa1105c71a0402d6621f6113b4b0d4923 Mon Sep 17 00:00:00 2001 From: wx-11-ot <168356742+wx-11@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:48:29 +0800 Subject: [PATCH] fix: Enable long press selection on mobile for all modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, long press to select files only worked in singleClick mode, making it impossible to select files on mobile devices in normal mode where right-click is not available. This fix enables long press selection regardless of singleClick setting, which is essential for mobile usability. Changes: - Remove singleClick condition from handleLongPress - Properly handle long press in itemClick for both modes Fixes regression introduced in commit 8d752204 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- frontend/src/components/files/ListingItem.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 14d897cf..595ae98b 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -225,7 +225,10 @@ const itemClick = (event: Event | KeyboardEvent) => { // If long press was triggered, prevent normal click behavior if (longPressTriggered.value) { longPressTriggered.value = false; - return; + // In non-singleClick mode, long press should only select, not open + if (!singleClick.value) { + return; + } } if ( @@ -318,10 +321,10 @@ const cancelLongPress = () => { }; const handleLongPress = () => { - if (singleClick.value) { - longPressTriggered.value = true; - click(new Event("longpress")); - } + // Allow long press to select items regardless of singleClick mode + // This is essential for mobile devices where right-click is not available + longPressTriggered.value = true; + click(new Event("longpress")); cancelLongPress(); };