Fix: Prevent arrow key navigation in textareas #1
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.
Fixes CodeYourFuture#1072
This PR resolves the issue where pressing left/right arrow keys in textareas on the prep view triggers navigation instead of moving the cursor within the textarea.
What does this change?
This PR modifies the
handleKeydownfunction incommon-theme/assets/scripts/solo-view.jsto check if the event target is an editable element (TEXTAREA, INPUT, SELECT, or contentEditable) before triggering navigation. If the user is typing in an editable element, the function returns early, allowing the default browser behavior (cursor movement) instead of triggering page navigation.Common Content?
Common Theme?
Issue number: CodeYourFuture#1072
Org Content?
N/A
Checklist
Who needs to know about this?
This fixes a bug that was affecting users trying to type in textareas on prep pages. The previous PR CodeYourFuture#1445 attempted to fix this but was unsuccessful. This implementation properly handles all editable elements.