mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-22 13:00:56 -04:00
fix(client): completion modal cannot be closed using Escape key (#55431)
This commit is contained in:
@@ -128,6 +128,10 @@ class CompletionModal extends Component<
|
||||
}
|
||||
|
||||
handleKeypress(e: React.KeyboardEvent): void {
|
||||
if (e.key === 'Escape') {
|
||||
e.stopPropagation();
|
||||
this.props.close();
|
||||
}
|
||||
if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {
|
||||
e.preventDefault();
|
||||
// Since Hotkeys also listens to Ctrl + Enter we have to stop this event
|
||||
|
||||
Reference in New Issue
Block a user