Skip to content

Commit

Permalink
Enable cmd+I for form and contenteditable elements
Browse files Browse the repository at this point in the history
Closes #351
  • Loading branch information
colebemis committed Jun 18, 2024
1 parent 6a228a4 commit 0606827
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/nav-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,17 @@ function NewNoteButton({
[openPanel, panels, routerNavigate],
)

useHotkeys("mod+i", (event) => {
navigate(`/${Date.now()}`)
event.preventDefault()
})
useHotkeys(
"mod+i",
(event) => {
navigate(`/${Date.now()}`)
event.preventDefault()
},
{
enableOnFormTags: true,
enableOnContentEditable: true,
},
)

return (
<IconButton
Expand Down

0 comments on commit 0606827

Please sign in to comment.