fix: prevent context menu clicks from clearing file selection

Right-clicking on a file and selecting Share or Rename would clear
the selection before the action could be performed, because the
click handler was treating context menu clicks as regular clicks.

Added early return when clicking inside .context-menu to preserve
the file selection during context menu interactions.

Fixes #5680
This commit is contained in:
Andy Bodnar 2026-01-10 13:39:41 -07:00
parent 037e29a708
commit 891d6c6b03

View File

@ -1059,6 +1059,9 @@ const handleEmptyAreaClick = (e: MouseEvent) => {
if (target.closest("item") || target.closest(".item")) return; if (target.closest("item") || target.closest(".item")) return;
// Do not clear selection when clicking on context menu actions
if (target.closest(".context-menu")) return;
fileStore.selected = []; fileStore.selected = [];
}; };
</script> </script>