fix: prevent the right-click from selecting multiple items when the "single-click" option is active (#5608)

This commit is contained in:
Ariel Leyva 2025-12-07 01:35:47 -05:00 committed by GitHub
parent 4cbb4b73af
commit 152f8302f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -265,7 +265,15 @@ const click = (event: Event | KeyboardEvent) => {
}
if (fileStore.selected.indexOf(props.index) !== -1) {
fileStore.removeSelected(props.index);
if (
(event as KeyboardEvent).ctrlKey ||
(event as KeyboardEvent).metaKey ||
fileStore.multiple
) {
fileStore.removeSelected(props.index);
} else {
fileStore.selected = [props.index];
}
return;
}
@ -291,7 +299,6 @@ const click = (event: Event | KeyboardEvent) => {
}
if (
!singleClick.value &&
!(event as KeyboardEvent).ctrlKey &&
!(event as KeyboardEvent).metaKey &&
!fileStore.multiple