Skip to content

Commit

Permalink
fix: insertion ui: losing focus on tab key
Browse files Browse the repository at this point in the history
  • Loading branch information
stdword committed Jul 5, 2024
1 parent cdb1650 commit d6bf556
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ui/insert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,17 @@ function InsertUI({ blockUUIDs, isSelectedState }) {

const returnFocus = (event: FocusEvent) => {
const input = event.target! as HTMLInputElement
// TODO: this doesn't work
input.focus()
}

const actWithHighlightedItem = (event: KeyboardEvent) => {
if (event.key === 'Tab') {
event.preventDefault()
const input = event.target! as HTMLInputElement
input.focus()
}

if (event.key === 'Alt') {
setOptKeyPressed(true)
}
Expand Down

0 comments on commit d6bf556

Please sign in to comment.