Skip to content

Commit 57ad181

Browse files
fix(desktop): enable ctrl+n and ctrl+p for popover navigation (anomalyco#10777)
1 parent 4f60ea6 commit 57ad181

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

packages/app/src/components/prompt-input.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,13 +1037,17 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
10371037
return
10381038
}
10391039

1040+
const ctrl = event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey
1041+
10401042
if (store.popover) {
10411043
if (event.key === "Tab") {
10421044
selectPopoverActive()
10431045
event.preventDefault()
10441046
return
10451047
}
1046-
if (event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "Enter") {
1048+
const nav = event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "Enter"
1049+
const ctrlNav = ctrl && (event.key === "n" || event.key === "p")
1050+
if (nav || ctrlNav) {
10471051
if (store.popover === "at") {
10481052
atOnKeyDown(event)
10491053
event.preventDefault()
@@ -1057,8 +1061,6 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
10571061
}
10581062
}
10591063

1060-
const ctrl = event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey
1061-
10621064
if (ctrl && event.code === "KeyG") {
10631065
if (store.popover) {
10641066
setStore("popover", null)

0 commit comments

Comments
 (0)