fix(dialog): improve escape key handling for dialogs
The handling of the Escape key has been refined to ensure that it closes the correct dialog based on the current state. Additionally, the z-index for the compare dialog backdrop has been updated to ensure proper layering with other dialogs. - Enhanced Escape key functionality for better user experience - Updated z-index for compare dialog backdrop to avoid overlap
This commit is contained in:
+2
-2
@@ -3967,10 +3967,10 @@
|
|||||||
helpOpen = false;
|
helpOpen = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.key === "Escape" && fileHistoryDialogOpen && !isBusy) closeFileHistoryDialog();
|
if (event.key === "Escape" && compareDialogOpen) closeCompareDialog();
|
||||||
|
else if (event.key === "Escape" && fileHistoryDialogOpen && !isBusy) closeFileHistoryDialog();
|
||||||
else if (event.key === "Escape" && repoTabContextMenu) closeRepoTabContextMenu();
|
else if (event.key === "Escape" && repoTabContextMenu) closeRepoTabContextMenu();
|
||||||
else if (event.key === "Escape" && pendingDiscard && !isBusy) closeDiscardConfirm();
|
else if (event.key === "Escape" && pendingDiscard && !isBusy) closeDiscardConfirm();
|
||||||
else if (event.key === "Escape" && compareDialogOpen) closeCompareDialog();
|
|
||||||
else if (event.key === "Escape" && newBranchCommit) newBranchCommit = null;
|
else if (event.key === "Escape" && newBranchCommit) newBranchCommit = null;
|
||||||
else if (event.key === "Escape" && renameBranchTarget) renameBranchTarget = null;
|
else if (event.key === "Escape" && renameBranchTarget) renameBranchTarget = null;
|
||||||
else if (event.key === "Escape" && deleteBranchTarget) closeDeleteBranchDialog();
|
else if (event.key === "Escape" && deleteBranchTarget) closeDeleteBranchDialog();
|
||||||
|
|||||||
@@ -2882,6 +2882,7 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.file-history-dialog-backdrop { z-index: 70; }
|
.file-history-dialog-backdrop { z-index: 70; }
|
||||||
|
.compare-dialog-backdrop { z-index: 80; }
|
||||||
.file-history-dialog {
|
.file-history-dialog {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: auto minmax(0, 1fr);
|
grid-template-rows: auto minmax(0, 1fr);
|
||||||
|
|||||||
@@ -216,7 +216,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="dialog-backdrop"
|
class="dialog-backdrop compare-dialog-backdrop"
|
||||||
role="presentation"
|
role="presentation"
|
||||||
>
|
>
|
||||||
<div class="dialog compare-dialog" role="dialog" aria-modal="true" aria-label="Commit comparison" tabindex="-1">
|
<div class="dialog compare-dialog" role="dialog" aria-modal="true" aria-label="Commit comparison" tabindex="-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user