File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ const closeModal = () => modalRef.value?.close?.()
9797 </li >
9898 </ul >
9999 <p class =" text-fg-muted leading-relaxed" >
100- <i18n-t keypath =" shortcuts.disable_shortcuts_description " tag =" span" scope =" global" >
100+ <i18n-t keypath =" shortcuts.disable " tag =" span" scope =" global" >
101101 <template #settings >
102102 <NuxtLink
103103 :to =" { name: 'settings' }"
Original file line number Diff line number Diff line change @@ -97,8 +97,10 @@ function removePackage(name: string) {
9797 packages .value = packages .value .filter (p => p !== name )
9898}
9999
100+ const keyboardShortcutsEnabled = useKeyboardShortcuts ()
101+
100102function handleKeydown(e : KeyboardEvent ) {
101- if (! useKeyboardShortcuts (). value ) return
103+ if (! keyboardShortcutsEnabled ) return
102104
103105 const items = navigableItems .value
104106 const count = items .length
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ const isLink = computed(() => props.variant === 'link')
5959const isButton = computed (() => ! isLink .value )
6060const isButtonSmall = computed (() => props .size === ' small' && ! isLink .value )
6161const isButtonMedium = computed (() => props .size === ' medium' && ! isLink .value )
62- const keyboardShortcutsEnabled = computed (() => import .meta .client && useKeyboardShortcuts ().value )
62+ const keyboardShortcuts = useKeyboardShortcuts ()
63+ const keyboardShortcutsEnabled = computed (() => import .meta .client && keyboardShortcuts .value )
6364 </script >
6465
6566<template >
Original file line number Diff line number Diff line change 3434 "go_to_result" : " Go to result" ,
3535 "open_code_view" : " Open code view" ,
3636 "open_docs" : " Open docs" ,
37- "disable_shortcuts" : " Disable shortcuts" ,
38- "disable_shortcuts_description" : " You could disable keyboard shortcuts in {settings}."
37+ "disable_shortcuts" : " You could disable keyboard shortcuts in {settings}."
3938 },
4039 "search" : {
4140 "label" : " Search npm packages" ,
Original file line number Diff line number Diff line change 108108 },
109109 "disable_shortcuts" : {
110110 "type" : " string"
111- },
112- "disable_shortcuts_description" : {
113- "type" : " string"
114111 }
115112 },
116113 "additionalProperties" : false
Original file line number Diff line number Diff line change 3333 "go_to_result" : " Go to result" ,
3434 "open_code_view" : " Open code view" ,
3535 "open_docs" : " Open docs" ,
36- "disable_shortcuts" : " Disable shortcuts" ,
37- "disable_shortcuts_description" : " You could disable keyboard shortcuts in {settings}."
36+ "disable_shortcuts" : " You could disable keyboard shortcuts in {settings}."
3837 },
3938 "search" : {
4039 "label" : " Search npm packages" ,
Original file line number Diff line number Diff line change 3333 "go_to_result" : " Go to result" ,
3434 "open_code_view" : " Open code view" ,
3535 "open_docs" : " Open docs" ,
36- "disable_shortcuts" : " Disable shortcuts" ,
37- "disable_shortcuts_description" : " You could disable keyboard shortcuts in {settings}."
36+ "disable_shortcuts" : " You could disable keyboard shortcuts in {settings}."
3837 },
3938 "search" : {
4039 "label" : " Search npm packages" ,
You can’t perform that action at this time.
0 commit comments