fix(dashboard): don't close Properties when a text selection ends on the backdrop

Drag-selecting the path or UID in the properties dialog and releasing over
the dimmed backdrop closed the dialog: the click lands on the overlay when
press and release are on different elements. The backdrop now closes it
only when the press started there, as the share dialog already does.
This commit is contained in:
Nariman Jelveh committed 2026-10-23 14:04:33 -07:00
1 parent 0a291e936b
commit 93359218bb
1 file changed
+7 -1
@@ -118,8 +118,14 @@ export default function UIItemPropertiesModal ({ name, path: item_path, uid, $co
// -- Dismissal wiring --
$overlay.on('click', '.item-props-close', close);
// Backdrop close goes by where the press started: a text selection dragged
// out of the card registers its click on the overlay.
let backdrop_pressed = false;
$overlay.on('mousedown', function (e) {
backdrop_pressed = e.target === $overlay[0];
});
$overlay.on('click', function (e) {
if ( e.target === $overlay[0] ) close();
if ( e.target === $overlay[0] && backdrop_pressed ) close();
});
$(document).on(keydown_ns, function (e) {
if ( e.key === 'Escape' && isOverlayOnTop($overlay[0]) ) close();