Skip to content

Fix: isInKeyRange doesn't filter modifier/navigation keys#1271

Merged
f3l1x merged 2 commits intomasterfrom
fix/is-in-key-range-named-keys
Mar 17, 2026
Merged

Fix: isInKeyRange doesn't filter modifier/navigation keys#1271
f3l1x merged 2 commits intomasterfrom
fix/is-in-key-range-named-keys

Conversation

@radimvaculik
Copy link
Member

Summary

  • isInKeyRange used e.key.charCodeAt(0) but fell back to 0 for named keys like "Tab", "Shift", "ArrowLeft" (length > 1), making the range check always false for those keys
  • The fix returns true immediately for any key with e.key.length !== 1 — these are always named special/modifier/navigation keys and should be ignored by autosubmit

Fixes #1267

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
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.19%. Comparing base (1735e53) to head (373aaf7).
⚠️ Report is 7 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link

@f3l1x f3l1x merged commit c9835f1 into master Mar 17, 2026
9 checks passed
@f3l1x f3l1x deleted the fix/is-in-key-range-named-keys branch March 17, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: isInKeyRange function doesn't filter modifier/navigation keys

2 participants