Skip to content

Commit

Permalink
Update contextmenu keyboard focus handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kadiryazici committed Mar 17, 2024
1 parent 6e3bad9 commit dadbd45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { handleTransition } from '../utils/wowerlay'
import type { Option } from '../types'
import type { ContextMenuState } from '../composables/useContextMenu'
import type { ItemMeta } from './MenuItems.vue'
import MenuItems from './MenuItems.vue'
</script>

Expand Down Expand Up @@ -33,8 +34,8 @@ function handleSetup(ctx: Context) {
useKey(
shortcut,
() => {
ctx.setFocusByKey(item.key)
ctx.selectFocusedItem()
item.onSelect?.(item.meta as ItemMeta, item, ctx.getItemElementByKey(item.key)!)
emit('close')
},
{ prevent: true },
)
Expand Down

0 comments on commit dadbd45

Please sign in to comment.