Skip to content

Commit

Permalink
fix: types and focused date logic
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Feb 16, 2025
1 parent 390ca1a commit 91876d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/useCalendar/useCalendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export function useCalendar(_props: Reactivify<CalendarProps, 'field' | 'schema'
watch(
() => pickerContext?.isOpen(),
async value => {
if (!value) {
if (pickerContext && !value) {
focusedDay.value = undefined;
setView('weeks');
return;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/usePicker/usePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function usePicker(_props: Reactivify<PickerProps>) {
return withRefCapture(
{
role: 'dialog',
'aria-modal': 'true',
'aria-modal': 'true' as const,
'aria-label': toValue(props.label),
},
pickerEl,
Expand Down
6 changes: 4 additions & 2 deletions packages/playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const maxDate = new Date(2025, 1, 18, 0, 0, 0, 0);

<template>
<div class="flex flex-col gap-4">
<DateField
<!-- <DateField
name="date"
label="Date"
:format-options="{
Expand All @@ -21,6 +21,8 @@ const maxDate = new Date(2025, 1, 18, 0, 0, 0, 0);
minute: '2-digit',
second: '2-digit',
}"
/>
/> -->

<Calendar label="Pick a date" :model-value="new Date('2025-09-16')" />
</div>
</template>

0 comments on commit 91876d5

Please sign in to comment.