Skip to content

fix(caret): prevent misplacement in zen mode with blind mode on (@byseif21)#7584

Open
byseif21 wants to merge 2 commits intomonkeytypegame:masterfrom
byseif21:fix/cart-zen-with-blind
Open

fix(caret): prevent misplacement in zen mode with blind mode on (@byseif21)#7584
byseif21 wants to merge 2 commits intomonkeytypegame:masterfrom
byseif21:fix/cart-zen-with-blind

Conversation

@byseif21
Copy link
Contributor

@byseif21 byseif21 commented Mar 6, 2026

issue: caret miss positioned in zen mode if having blind mode on.

  • there’s no predefined word text, so the caret clamp used wordText.length and ended up with an invalid index in blind mode

Copilot AI review requested due to automatic review settings March 6, 2026 17:56
@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Mar 6, 2026
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Mar 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes caret mispositioning in Zen mode when Blind Mode (or Hide Extra Letters) is enabled by preventing an invalid clamp index when there’s no predefined wordText available.

Changes:

  • Adjust caret clamping logic to fall back to DOM letters.length when wordText is missing.
  • Prevents invalid letterIndex values (previously could become NaN) in Zen + Blind Mode scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants