Skip to content

Commit 99da62b

Browse files
jloh02ravern
andauthored
fix(timetable): ESC key not working sometimes (#3680)
Co-authored-by: Ravern Koh <[email protected]>
1 parent be22c79 commit 99da62b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

website/src/views/timetable/TimetableCell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const TimetableCell: React.FC<Props> = (props) => {
128128
onTouchStart={() => onHover(getHoverLesson(lesson))}
129129
onMouseLeave={() => onHover(null)}
130130
onTouchEnd={() => onHover(null)}
131+
autoFocus={lesson.isActive}
131132
{...conditionalProps}
132133
>
133134
<div className={styles.cellContainer}>

website/src/views/timetable/TimetableContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ class TimetableContent extends React.Component<Props, State> {
356356
verticalMode: isVerticalOrientation,
357357
})}
358358
onClick={this.cancelModifyLesson}
359-
onKeyUp={(e) => e.keyCode === 27 && this.cancelModifyLesson()} // Quit modifying when Esc is pressed
359+
onKeyUp={(e) => e.key === 'Escape' && this.cancelModifyLesson()} // Quit modifying when Esc is pressed
360360
>
361361
<Title>Timetable</Title>
362362

0 commit comments

Comments
 (0)