Skip to content

Commit 376009c

Browse files
authored
Remove ctrl-n/p shortcuts in quick actions (#3187)
It occurred to me they don't work on Linux. Had someone confirm — they found that ctrl-p worked but ctrl-n still opened a new window.
1 parent 7bf337b commit 376009c

2 files changed

Lines changed: 2 additions & 26 deletions

File tree

app/ui/lib/ActionMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ export function ActionMenu(props: ActionMenuProps) {
109109
e.preventDefault()
110110
onDismiss()
111111
}
112-
} else if (e.key === KEYS.down || (e.ctrlKey && e.key === 'n')) {
112+
} else if (e.key === KEYS.down) {
113113
e.preventDefault()
114114
const newIdx = selectedIdx === lastIdx ? 0 : selectedIdx + 1
115115
setSelectedIdx(newIdx)
116-
} else if (e.key === KEYS.up || (e.ctrlKey && e.key === 'p')) {
116+
} else if (e.key === KEYS.up) {
117117
e.preventDefault()
118118
const newIdx = selectedIdx === 0 ? lastIdx : selectedIdx - 1
119119
setSelectedIdx(newIdx)

test/e2e/action-menu.e2e.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,6 @@ test('Enter key does not prematurely submit a linked form', async ({ page }) =>
2929
await expectNotVisible(page, [page.getByText('Name is required')])
3030
})
3131

32-
test('Ctrl+N/P navigate up and down', async ({ page }) => {
33-
await page.goto('/projects/mock-project/instances')
34-
await openActionMenu(page)
35-
36-
// wait for instance list to load so the items don't shift mid-test
37-
await expect(page.getByRole('option', { name: 'db1' })).toBeVisible()
38-
39-
const selected = getSelectedItem(page)
40-
// first item is selected by default
41-
await expect(selected).toHaveText('New instance')
42-
43-
// Ctrl+N moves down
44-
await page.keyboard.press('Control+n')
45-
await expect(selected).toHaveText('db1')
46-
47-
// Ctrl+P moves back up
48-
await page.keyboard.press('Control+p')
49-
await expect(selected).toHaveText('New instance')
50-
51-
// Ctrl+N again gets the same second item
52-
await page.keyboard.press('Control+n')
53-
await expect(selected).toHaveText('db1')
54-
})
55-
5632
test('Arrow keys navigate up and down', async ({ page }) => {
5733
await page.goto('/projects/mock-project/instances')
5834
await openActionMenu(page)

0 commit comments

Comments
 (0)