fix: prevent execution while submitting

pull/37148/head
Oliver Eyton-Williams 2019-10-09 11:41:47 +02:00 committed by mrugesh
parent 040eb2d51d
commit feb96c3e3b
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@ const mapDispatchToProps = function(dispatch) {
handleKeypress: e => { handleKeypress: e => {
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
e.preventDefault(); e.preventDefault();
// Since Hotkeys also listens to Ctrl + Enter we have to stop this event
// getting to it.
e.stopPropagation();
dispatch(submitChallenge()); dispatch(submitChallenge());
} }
}, },