Skip to content

Commit

Permalink
fix(VList): ignore input element interactions (#20881)
Browse files Browse the repository at this point in the history
fixes #20523
  • Loading branch information
J-Sek authored Jan 23, 2025
1 parent 9e5a3c8 commit f54ca9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vuetify/src/components/VList/VListGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const VListGroup = genericComponent<VListGroupSlots>()({

function onClick (e: Event) {
e.stopPropagation()
if (['INPUT', 'TEXTAREA'].includes((e.target as Element)?.tagName)) return
open(!isOpen.value, e)
}

Expand Down
2 changes: 2 additions & 0 deletions packages/vuetify/src/components/VList/VListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export const VListItem = genericComponent<VListItemSlots>()({

function onClick (e: MouseEvent) {
emit('click', e)
if (['INPUT', 'TEXTAREA'].includes((e.target as Element)?.tagName)) return

if (!isClickable.value) return

Expand All @@ -201,6 +202,7 @@ export const VListItem = genericComponent<VListItemSlots>()({
}

function onKeyDown (e: KeyboardEvent) {
if (['INPUT', 'TEXTAREA'].includes((e.target as Element)?.tagName)) return
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault()
e.target!.dispatchEvent(new MouseEvent('click', e))
Expand Down

0 comments on commit f54ca9a

Please sign in to comment.