Skip to content

Commit

Permalink
fix(VDialog): emit afterEnter before setting focus
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Aug 21, 2024
1 parent b861d8c commit 7e9a1b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vuetify/src/components/VDialog/VDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const VDialog = genericComponent<OverlaySlots>()({

emits: {
'update:modelValue': (value: boolean) => true,
afterEnter: () => true,
afterLeave: () => true,
},

Expand Down Expand Up @@ -89,6 +90,7 @@ export const VDialog = genericComponent<OverlaySlots>()({
}

function onAfterEnter () {
emit('afterEnter')
if (overlay.value?.contentEl && !overlay.value.contentEl.contains(document.activeElement)) {
overlay.value.contentEl.focus({ preventScroll: true })
}
Expand Down

0 comments on commit 7e9a1b7

Please sign in to comment.