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 ( return (
<button <button
onClick={onClick} onClick={(e) => !disabled && onClick()}
onKeyDown={onKeyDown} onKeyDown={(e) => !disabled && onKeyDown(e)}
onMouseEnter={onMouseEnter} onMouseEnter={(e) => !disabled && onMouseEnter()}
tabIndex={tabIndex} tabIndex={tabIndex}
type="button" type="button"
ref={dayRef} ref={dayRef}