fix: Enable long press selection on mobile for all modes

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 <noreply@anthropic.com>
This commit is contained in:
wx-11-ot 2025-08-06 16:48:29 +08:00
parent 6d620c00a1
commit 5e36dd3aa1

View File

@ -225,8 +225,11 @@ const itemClick = (event: Event | KeyboardEvent) => {
// If long press was triggered, prevent normal click behavior
if (longPressTriggered.value) {
longPressTriggered.value = false;
// In non-singleClick mode, long press should only select, not open
if (!singleClick.value) {
return;
}
}
if (
singleClick.value &&
@ -318,10 +321,10 @@ const cancelLongPress = () => {
};
const handleLongPress = () => {
if (singleClick.value) {
// 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();
};