Skip to content

Commit a5caf32

Browse files
Mamadukat-hamano
andauthored
Notes: Pressing Escape should cancel adding a note (#75288)
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
1 parent 8b3e987 commit a5caf32

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/editor/src/components/collab-sidebar/comment-form.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ function CommentForm( {
7777
) {
7878
event.target.parentNode.requestSubmit();
7979
}
80+
81+
if ( event.key === 'Escape' ) {
82+
event.preventDefault();
83+
// Passing event for reply forms.
84+
onCancel( event );
85+
}
8086
} }
8187
/>
8288
<HStack spacing="2" justify="flex-end" wrap>

0 commit comments

Comments
 (0)