Skip to content
Merged
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
17 changes: 17 additions & 0 deletions packages/supersearch/e2e/supersearch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,23 @@ test('supports keyboard navigation between rows and columns/cells', async ({ pag
).toHaveAttribute('aria-activedescendant', 'supersearch-item-2x0');
});

// Ensure https://github.com/libris/lxlviewer/pull/1652 does not regress
test('ensure arrow key handling is reset when clicking expanded input', async ({ page }) => {
await page.getByRole('combobox').click();
await page.getByRole('dialog').getByRole('combobox').fill('abde');
await page.waitForResponse(
(res) => res.url().includes('/api/find?_q=abde') && res.status() === 200
);
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowDown');
await page.getByRole('dialog').getByRole('combobox').click();
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('c');
await expect(page.getByRole('dialog').getByRole('combobox')).toHaveText('abcde');
});

test('user can toggle expanded search using alt key + arrow up or down (without moving cursor) ', async ({
page
}) => {
Expand Down
1 change: 1 addition & 0 deletions packages/supersearch/src/lib/components/SuperSearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
activeColIndex = defaultResultCol;
} else {
activeColIndex = defaultInputCol;
allowArrowKeyCursorHandling = { vertical: false, horizontal: true };
}
}

Expand Down
Loading