mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-06 22:13:04 +00:00
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:
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();
|
||||
|
||||
Reference in new issue
Block a user