Skip to content

Commit 193301c

Browse files
TIM56887johnleider
andauthored
fix(VMenu): allow enter keypress to work in input element (#19922)
fixes #19920 Co-authored-by: John Leider <john@vuetifyjs.com>
1 parent 5b5bf50 commit 193301c

File tree

1 file changed

+5
-1
lines changed
  • packages/vuetify/src/components/VMenu

1 file changed

+5
-1
lines changed

packages/vuetify/src/components/VMenu/VMenu.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ export const VMenu = genericComponent<OverlaySlots>()({
127127
if (props.disabled) return
128128

129129
if (e.key === 'Tab' || (e.key === 'Enter' && !props.closeOnContentClick)) {
130-
if (e.key === 'Enter' && e.target instanceof HTMLTextAreaElement) return
130+
if (
131+
e.key === 'Enter' &&
132+
((e.target instanceof HTMLTextAreaElement) ||
133+
(e.target instanceof HTMLInputElement && !!e.target.closest('form')))
134+
) return
131135
if (e.key === 'Enter') e.preventDefault()
132136

133137
const nextElement = getNextElement(

0 commit comments

Comments
 (0)