From 3445ecb64c571bba4c4b6c5b44a1f2ac41334ed5 Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Fri, 25 Feb 2022 12:57:16 +0200 Subject: [PATCH] (core) Search backwards with Shift+Enter Summary: As simple as it sounds. Check ev.shiftKey in Enter key handler in search.ts. Test Plan: Extended test/nbrowser/Search.ts Reviewers: jarek Reviewed By: jarek Subscribers: jarek Differential Revision: https://phab.getgrist.com/D3293 --- 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 56f8cd83..a28319c9 100644 --- a/app/client/ui2018/search.ts +++ b/app/client/ui2018/search.ts @@ -147,7 +147,7 @@ export function searchBar(model: SearchModel, testId: TestId = noTestId) { toggleMenu(false) )), dom.onKeyDown({ - Enter: () => model.findNext(), + Enter: (ev) => ev.shiftKey ? model.findPrev() : model.findNext(), Escape: () => { keepExpanded = false; toggleMenu(false); }, // Catch both Tab and Shift+Tab to prevent focus entering unrelated editable label. Tab: () => toggleMenu(false),