mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
fix(Modal/Slideover): don't emit close:prevent on closeAutoFocus
This commit is contained in:
@@ -104,15 +104,15 @@ const contentEvents = computed(() => {
|
||||
}
|
||||
|
||||
if (!props.dismissible) {
|
||||
const events = ['pointerDownOutside', 'interactOutside', 'escapeKeyDown', 'closeAutoFocus'] as const
|
||||
type EventType = typeof events[number]
|
||||
const events = ['pointerDownOutside', 'interactOutside', 'escapeKeyDown']
|
||||
|
||||
return events.reduce((acc, curr) => {
|
||||
acc[curr] = (e: Event) => {
|
||||
e.preventDefault()
|
||||
emits('close:prevent')
|
||||
}
|
||||
return acc
|
||||
}, {} as Record<EventType, (e: Event) => void>)
|
||||
}, defaultEvents as Record<typeof events[number] | keyof typeof defaultEvents, (e: Event) => void>)
|
||||
}
|
||||
|
||||
return defaultEvents
|
||||
|
||||
Reference in New Issue
Block a user