Fix issue with download solution on completion modal (#34967) (#35317)

When the user downloads their solution before proceeding to the next challenge, the solution is downloaded again on Ctrl + Enter.

The issue is that once the user has downloaded their solution, the download button is in focus, so pressing Ctrl + Enter will not only dispatch the submit challenge event, it'll also dispatch the click event on the download button which is not what we want. This disables that event.

Closes #34967
This commit is contained in:
rituteb
2019-02-21 04:06:52 -05:00
committed by Valeriy
parent 5cb5c11df9
commit 6f12526fe1

View File

@ -39,6 +39,7 @@ const mapDispatchToProps = function(dispatch) {
close: () => dispatch(closeModal('completion')),
handleKeypress: e => {
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
e.preventDefault();
dispatch(submitChallenge());
}
},