Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function useDocSearchKeyboardEvents({
function onKeyDown(event: KeyboardEvent): void {
if (isOpen && event.code === 'Escape' && isAskAiActive) {
onAskAiToggle(false);
onClose();
Copy link
Contributor

@8bittitan 8bittitan Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe these are the correct places for this. This block is meant to "leave" the Ask AI experience and go back to the keyword search experience, without closing the modal.

I believe the issue is more that the cleanup of this useEffect is not getting ran, causing the keydown event listener to never get removed.

The root issue for the modal opening again is that we focus the search button on close, and then have a listener that opens the modal again on keypress if the search button is the focused element.

return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function useDocSearchKeyboardEvents({
function onKeyDown(event: KeyboardEvent): void {
if (isOpen && event.code === 'Escape' && isAskAiActive) {
onAskAiToggle(false);
onClose();
return;
}

Expand Down