fix(ui): stop click propagation on the multi-select checkbox
The checkbox button calls togglePathSelection() on click but does not stop event propagation, so the click bubbles to the parent row's onClick which calls executeRow() -> browseToEntry(). With a mouse, every checkbox click would (a) toggle the selection, (b) navigate into the directory, and (c) the navigation effect would clear selectedPaths. The primary interaction of the multi-select feature was unusable. The existing handleQuickAdd helper avoids this exact bug by calling event.stopPropagation() inside its onClick handler. Apply the same pattern to the new togglePathSelection onClick. Refs openchamber-bot review on #2877.
This commit is contained in:
@@ -740,7 +740,7 @@ export const DirectoryExplorerDialog: React.FC<DirectoryExplorerDialogProps> = (
|
||||
<button
|
||||
type="button"
|
||||
onMouseDown={(event) => event.stopPropagation()}
|
||||
onClick={() => togglePathSelection(row.path)}
|
||||
onClick={(event) => { event.stopPropagation(); togglePathSelection(row.path); }}
|
||||
title={t('directoryExplorerDialog.browse.selectForAdd')}
|
||||
aria-label={t('directoryExplorerDialog.browse.selectForAdd')}
|
||||
aria-pressed={selectedPaths.includes(row.path)}
|
||||
|
||||
Reference in New Issue
Block a user