Skip to content

Commit

Permalink
fix(VDateInput): add missing slot pass-through
Browse files Browse the repository at this point in the history
fixes #20060
  • Loading branch information
johnleider committed Feb 17, 2025
1 parent 8294e8c commit 4815d05
Showing 1 changed file with 49 additions and 42 deletions.
91 changes: 49 additions & 42 deletions packages/vuetify/src/labs/VDateInput/VDateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,48 +147,55 @@ export const VDateInput = genericComponent<VDateInputSlots>()({
onClick:prepend={ isInteractive.value ? onClick : undefined }
onUpdate:modelValue={ onUpdateModel }
>
<VMenu
v-model={ menu.value }
activator="parent"
min-width="0"
location={ props.location }
closeOnContentClick={ false }
openOnClick={ false }
>
<VConfirmEdit
{ ...confirmEditProps }
v-model={ model.value }
onSave={ onSave }
onCancel={ () => menu.value = false }
>
{{
default: ({ actions, model: proxyModel, save, cancel, isPristine }) => {
return (
<VDatePicker
{ ...datePickerProps }
modelValue={ props.hideActions ? model.value : proxyModel.value }
onUpdate:modelValue={ val => {
if (!props.hideActions) {
proxyModel.value = val
} else {
model.value = val

if (!props.multiple) menu.value = false
}
}}
onMousedown={ (e: MouseEvent) => e.preventDefault() }
>
{{
actions: !props.hideActions ? () => slots.actions?.({ save, cancel, isPristine }) ?? actions() : undefined,
}}
</VDatePicker>
)
},
}}
</VConfirmEdit>
</VMenu>

{ slots.default?.() }
{{
...slots,
default: () => (
<>
<VMenu
v-model={ menu.value }
activator="parent"
min-width="0"
location={ props.location }
closeOnContentClick={ false }
openOnClick={ false }
>
<VConfirmEdit
{ ...confirmEditProps }
v-model={ model.value }
onSave={ onSave }
onCancel={ () => menu.value = false }
>
{{
default: ({ actions, model: proxyModel, save, cancel, isPristine }) => {
return (
<VDatePicker
{ ...datePickerProps }
modelValue={ props.hideActions ? model.value : proxyModel.value }
onUpdate:modelValue={ val => {
if (!props.hideActions) {
proxyModel.value = val
} else {
model.value = val

if (!props.multiple) menu.value = false
}
}}
onMousedown={ (e: MouseEvent) => e.preventDefault() }
>
{{
actions: !props.hideActions ? () => slots.actions?.({ save, cancel, isPristine }) ?? actions() : undefined,
}}
</VDatePicker>
)
},
}}
</VConfirmEdit>
</VMenu>

{ slots.default?.() }
</>
),
}}
</VTextField>
)
})
Expand Down

0 comments on commit 4815d05

Please sign in to comment.