Skip to content

Commit

Permalink
feat(DatePicker): expose modal-value to make DatePickerInput optional (
Browse files Browse the repository at this point in the history
…#985)

* feat: exposes modal-value to make date-picker-input optional

* chore: update docs

---------

Co-authored-by: Eduard Predescu <[email protected]>
  • Loading branch information
canstand and epr3 authored Jun 3, 2024
1 parent 1b970ec commit d5fff4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/content/meta/DatePickerField.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
'name': 'segments',
'description': '',
'type': '{ part: SegmentPart; value: string; }[]'
},
{
'name': 'modelValue',
'description': '',
'type': 'DateValue | undefined'
}
]" />
4 changes: 2 additions & 2 deletions packages/radix-vue/src/DatePicker/DatePickerField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const rootContext = injectDatePickerRootContext()

<template>
<DateFieldRoot
v-slot="{ segments }"
v-slot="{ segments, modelValue }"
:ref="rootContext.dateFieldRef"
:model-value="rootContext.modelValue.value"
:placeholder="rootContext.placeholder.value"
Expand Down Expand Up @@ -38,6 +38,6 @@ const rootContext = injectDatePickerRootContext()
rootContext.onPlaceholderChange(date)
}"
>
<slot :segments="segments" />
<slot :segments="segments" :model-value="modelValue" />
</DateFieldRoot>
</template>

0 comments on commit d5fff4d

Please sign in to comment.