Fix the enter key behavior for MathQuill inputs. #1367
+9
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code looks for the
enter_key_submitsubmit button in the DOM, and if that is found then it clicks it. However, it doesn't return after that, but continues on the the later code in the method none of which should occur if that button is found. The later code executes the "gateway quiz" fallback which clicks the submit button with the name "previewAnswers". However, there is also a button with that name in homework.The behavior is different in different browsers with this. In Firefox the first button clicked seems to be what is in effect. However, in Google Chrome the second button clicked is in effect. So the desired behavior occurs in Firefox, but not in Google Chrome.
What needs to happen is that if the
enter_key_submitinput is found, then that should be clicked, and the method should return. There is no need for the fallback click of the submit button with the idpreviewAnswers_idotherwise. Instead just click the submit button with the namepreviewAnswerswhich is present in both homework sets and tests.I certainly thing that this should be a hotfix.