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:
parent
6d620c00a1
commit
5e36dd3aa1
@ -225,7 +225,10 @@ const itemClick = (event: Event | KeyboardEvent) => {
|
|||||||
// If long press was triggered, prevent normal click behavior
|
// If long press was triggered, prevent normal click behavior
|
||||||
if (longPressTriggered.value) {
|
if (longPressTriggered.value) {
|
||||||
longPressTriggered.value = false;
|
longPressTriggered.value = false;
|
||||||
return;
|
// In non-singleClick mode, long press should only select, not open
|
||||||
|
if (!singleClick.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -318,10 +321,10 @@ const cancelLongPress = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleLongPress = () => {
|
const handleLongPress = () => {
|
||||||
if (singleClick.value) {
|
// Allow long press to select items regardless of singleClick mode
|
||||||
longPressTriggered.value = true;
|
// This is essential for mobile devices where right-click is not available
|
||||||
click(new Event("longpress"));
|
longPressTriggered.value = true;
|
||||||
}
|
click(new Event("longpress"));
|
||||||
cancelLongPress();
|
cancelLongPress();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user