fix: fix disabled calendar days

Prevent clicking on disabled calendar days from changing the date.
This commit is contained in:
Hossein Mehrabi 2023-03-22 14:46:23 +03:30 committed by Jon
parent 2f6f391735
commit 82d4975cdc
1 changed files with 3 additions and 3 deletions

View File

@ -45,9 +45,9 @@ export const Day = ({ day, date, disabled = false }: DayProps) => {
return (
<button
onClick={onClick}
onKeyDown={onKeyDown}
onMouseEnter={onMouseEnter}
onClick={(e) => !disabled && onClick()}
onKeyDown={(e) => !disabled && onKeyDown(e)}
onMouseEnter={(e) => !disabled && onMouseEnter()}
tabIndex={tabIndex}
type="button"
ref={dayRef}