From 6f12526fe125cf4a3ada0a102b1768336f40966e Mon Sep 17 00:00:00 2001 From: rituteb <47578527+rituteb@users.noreply.github.com> Date: Thu, 21 Feb 2019 04:06:52 -0500 Subject: [PATCH] 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 --- client/src/templates/Challenges/components/CompletionModal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/templates/Challenges/components/CompletionModal.js b/client/src/templates/Challenges/components/CompletionModal.js index 3aa07bdf3c..4cf589c97d 100644 --- a/client/src/templates/Challenges/components/CompletionModal.js +++ b/client/src/templates/Challenges/components/CompletionModal.js @@ -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()); } },