Skip to content

Commit

Permalink
fix(VMenu): restore menu focus on enter inside input (vuetifyjs#19519)
Browse files Browse the repository at this point in the history
fixes vuetifyjs#19206

Co-authored-by: John Leider <[email protected]>
  • Loading branch information
elkofy and johnleider authored Apr 8, 2024
1 parent 619c00e commit 85ba4a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vuetify/src/components/VMenu/VMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export const VMenu = genericComponent<OverlaySlots>()({
function onKeydown (e: KeyboardEvent) {
if (props.disabled) return

if (e.key === 'Tab') {
if (e.key === 'Tab' || (e.key === 'Enter' && !props.closeOnContentClick)) {
if (e.key === 'Enter') e.preventDefault()

const nextElement = getNextElement(
focusableChildren(overlay.value?.contentEl as Element, false),
e.shiftKey ? 'prev' : 'next',
Expand Down

0 comments on commit 85ba4a8

Please sign in to comment.