Skip to content

Commit c86ad0b

Browse files
Mingzemergify[bot]
andauthored
feat(hotkeys): Press Esc to exit annotations mode (#517)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent e0bbd03 commit c86ad0b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/components/ReplyForm/ReplyForm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const ReplyForm = ({ errors, isPending, onCancel, onChange, setFieldValue, value
4141
return;
4242
}
4343

44+
event.preventDefault();
4445
event.stopPropagation();
4546
event.nativeEvent.stopImmediatePropagation();
4647

src/components/ReplyForm/__tests__/ReplyForm-test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ describe('components/ReplyForm/ReplyForm', () => {
7979
wrapper.find(Form).simulate('keyDown', { ...mockEvent, key });
8080

8181
expect(mockEvent.nativeEvent.stopImmediatePropagation).toHaveBeenCalledTimes(callCount);
82+
expect(mockEvent.preventDefault).toHaveBeenCalledTimes(callCount);
8283
expect(mockEvent.stopPropagation).toHaveBeenCalledTimes(callCount);
8384
expect(defaults.onCancel).toHaveBeenCalledTimes(callCount);
8485
});

0 commit comments

Comments
 (0)