Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/frontend/src/modals/codeAreaModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ export default function CodeAreaModal({
<BaseModal
onEscapeKeyDown={(e) => {
e.preventDefault();

// Check if AceEditor search box input is in the viewport
const searchInput = document.querySelector(
"input.ace_search_field",
) as HTMLInputElement;
const isSearchBoxVisible =
searchInput && searchInput.offsetParent !== null; // Check if element is visible

// If search box is visible, don't close the modal - let AceEditor handle escape
if (isSearchBoxVisible) {
return;
}

if (code === value) {
setOpen(false);
} else {
Expand Down
Loading