(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
This commit is contained in:
Alex Hall 2022-02-25 12:57:16 +02:00
parent a294eefdff
commit 3445ecb64c

View File

@ -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),