Fix: isInKeyRange doesn't filter modifier/navigation keys#1271
Merged
Conversation
Named keys have e.key.length > 1 (e.g. "Tab", "Shift", "ArrowLeft"), so charCodeAt(0) fell through to 0, making the range check always false. Now any multi-character key name is considered in-range and ignored by autosubmit. Fixes #1267
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1271 +/- ##
==========================================
- Coverage 49.91% 46.19% -3.72%
==========================================
Files 50 52 +2
Lines 2879 2680 -199
==========================================
- Hits 1437 1238 -199
Misses 1442 1442 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
isInKeyRangeusede.key.charCodeAt(0)but fell back to0for named keys like"Tab","Shift","ArrowLeft"(length > 1), making the range check always false for those keystrueimmediately for any key withe.key.length !== 1— these are always named special/modifier/navigation keys and should be ignored by autosubmitFixes #1267