From 8c6148dd9f9a3a6439b1a0a5a3c5cdb789655656 Mon Sep 17 00:00:00 2001 From: Cyprien P Date: Tue, 25 May 2021 14:24:36 +0200 Subject: [PATCH] (core) fix closing of the search bar Summary: - Sending `ESCAPE` while hovering the options panel was not working - This is because of the keepExpanded flag which was set to true - Solution is to set the keepExpanded flag to false, prior to toggling the Menu Test Plan: - Tested manually Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2836 --- app/client/ui2018/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/ui2018/search.ts b/app/client/ui2018/search.ts index 8e2c5c3e..7ca7e7c7 100644 --- a/app/client/ui2018/search.ts +++ b/app/client/ui2018/search.ts @@ -144,7 +144,7 @@ export function searchBar(model: SearchModel, testId: TestId = noTestId) { )), dom.onKeyDown({ Enter: () => model.findNext(), - Escape: () => toggleMenu(false), + Escape: () => { keepExpanded = false; toggleMenu(false); }, // Catch both Tab and Shift+Tab to prevent focus entering unrelated editable label. Tab: () => toggleMenu(false), }),