Skip to content

Commit

Permalink
fix: DatePicker crashing after selecting year
Browse files Browse the repository at this point in the history
  • Loading branch information
jaieds committed Dec 30, 2024
1 parent eebe69f commit e2de5d8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/components/datepicker/datepicker-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const DatePickerComponent = ( {
}
};

const handleYearClick = ( { yearValue }: { yearValue: number } ) => {
const handleYearClick = ( yearValue: number ) => {
setSelectedYear( yearValue );
setShowYearSelect( false );
setShowMonthSelect( true );
Expand Down Expand Up @@ -245,13 +245,7 @@ const DatePickerComponent = ( {
<Button
key={ yearValue }
variant="ghost"
onClick={ () =>
handleYearClick(
yearValue as unknown as {
yearValue: number;
}
)
}
onClick={ () => handleYearClick( yearValue ) }
className={ cn(
'h-10 w-full text-center font-normal relative',
yearValue === selectedYear &&
Expand Down

0 comments on commit e2de5d8

Please sign in to comment.