Skip to content

Commit

Permalink
Merge pull request #4854 from ryantanrk/chore/convert-month-test
Browse files Browse the repository at this point in the history
[typescript-migration] month_test.test.js
  • Loading branch information
martijnrusschen authored Jun 2, 2024
2 parents a73099e + 839ccbb commit abed5ac
Show file tree
Hide file tree
Showing 3 changed files with 226 additions and 163 deletions.
4 changes: 2 additions & 2 deletions src/day.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface DayProps
month: number;
onClick?: React.MouseEventHandler<HTMLDivElement>;
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
handleOnKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
handleOnKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
usePointerEvent?: boolean;
preSelection?: Date | null;
selected?: Date | null;
Expand Down Expand Up @@ -173,7 +173,7 @@ export default class Day extends Component<DayProps> {
event.key = KeyType.Enter;
}

this.props.handleOnKeyDown(event);
this.props.handleOnKeyDown?.(event);
};

isSameDay = (other: Date | null | undefined) =>
Expand Down
4 changes: 2 additions & 2 deletions src/week_number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface WeekNumberProps {
disabledKeyboardNavigation?: boolean;
inline?: boolean;
shouldFocusDayInline?: boolean;
handleOnKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
handleOnKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
containerRef?: React.RefObject<HTMLDivElement>;
isInputFocused?: boolean;
}
Expand Down Expand Up @@ -50,7 +50,7 @@ export default class WeekNumber extends Component<WeekNumberProps> {
event.key = KeyType.Enter;
}

this.props.handleOnKeyDown(event);
this.props.handleOnKeyDown?.(event);
};

isKeyboardSelected = (): boolean =>
Expand Down
Loading

0 comments on commit abed5ac

Please sign in to comment.