Skip to content

Commit

Permalink
fix: auto close date picker after selection (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
sravichandran-eightfold authored Nov 11, 2024
1 parent 0945765 commit 5c8c0ce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function DecadePartial<DateType>(props: DecadePartialProps<DateType>) {
},
onEnter: (): void => {
onPartialChange('year', viewDate);
onSelect(viewDate, 'mouse');
},
}),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function MonthPartial<DateType>(props: MonthPartialProps<DateType>) {
},
onEnter: (): void => {
onPartialChange('date', value || viewDate);
onSelect(value || viewDate, 'mouse');
},
}),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ function QuarterPartial<DateType>(props: QuarterPartialProps<DateType>) {
onUpDown: (diff: number): void => {
onSelect(generateConfig.addYear(value || viewDate, diff), 'key');
},
onEnter: (): void => {
onPartialChange('quarter', value || viewDate);
onSelect(value || viewDate, 'mouse');
},
}),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function YearPartial<DateType>(props: YearPartialProps<DateType>) {
sourceMode === 'date' ? 'date' : 'month',
value || viewDate
);
onSelect(value || viewDate, 'mouse');
},
}),
};
Expand Down

0 comments on commit 5c8c0ce

Please sign in to comment.