Skip to content

Commit

Permalink
fix(VMenu): allow enter keypress to work in textareas
Browse files Browse the repository at this point in the history
Previously, when a `<v-menu />` with `:close-on-content-click="false"`
contained a textarea, an enter press inside the textarea would do
nothing and not produce a new line. Now, it will allow a new line to be
typed into the textarea when pressing enter.

This last worked in Vuetify v3.5.14 and was broken starting in v3.5.15.
The fix for vuetifyjs#19519 in 85ba4a8 caused this issue.

fixes vuetifyjs#19767
  • Loading branch information
curtgrimes committed May 7, 2024
1 parent 7c64392 commit 054aea4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/vuetify/src/components/VMenu/VMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const VMenu = genericComponent<OverlaySlots>()({
if (props.disabled) return

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

const nextElement = getNextElement(
Expand Down

0 comments on commit 054aea4

Please sign in to comment.