mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-26 17:52:18 +01:00
allow users to type the letter n
This commit is contained in:
parent
ad6e51ed98
commit
1c8f68f66f
@ -17,7 +17,9 @@ export default function KeyboardShortcut({
|
||||
(e) => (requireMeta ? e.ctrlKey || e.metaKey : true) && e.key === letter,
|
||||
(e) => {
|
||||
// ignore if the user is focused on an input
|
||||
if (document.activeElement instanceof HTMLInputElement) return;
|
||||
if (document.activeElement instanceof HTMLInputElement || document.activeElement instanceof HTMLTextAreaElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (onPress) {
|
||||
e.preventDefault();
|
||||
|
@ -34,6 +34,7 @@ function LaunchpadPage() {
|
||||
<Flex gap="4" w="full">
|
||||
<Button colorScheme="primary" size="lg" onClick={() => openModal()} variant="outline">
|
||||
New Note
|
||||
<KeyboardShortcut letter="n" ml="2" onPress={(e) => openModal()} />
|
||||
</Button>
|
||||
<SearchForm flex={1} />
|
||||
</Flex>
|
||||
|
Loading…
x
Reference in New Issue
Block a user