Skip to content

fix(core): keep the caret in place when backspace has nothing to delete - #113

Merged
myromartsin merged 1 commit into
mainfrom
fix/digit-less-backspace-caret
Sep 1, 2026
Merged

fix(core): keep the caret in place when backspace has nothing to delete#113
myromartsin merged 1 commit into
mainfrom
fix/digit-less-backspace-caret

Conversation

@myromartsin

Copy link
Copy Markdown
Member

Summary

Backspace with no digit before the caret now stores the caller's selection in history, matching the caret-at-zero guard in the same method. Both input controllers rendered the previous edit's caret through currentState in that branch, which sent the DOM caret to the end of the field when backspacing on a fixed plus. Regression tests cover the fixed-plus and national leading-parenthesis cases.

Motivation

Closes #112.

Conformance impact

None.

Checklist

  • Tests added or updated (or a rationale for why none)
  • pnpm test, pnpm lint, pnpm format pass locally
  • Docs reflect the change (per CONTRIBUTING.md)
  • Commit message follows the project convention

@codspeed-hq

codspeed-hq Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 39 untouched benchmarks


Comparing fix/digit-less-backspace-caret (44896d5) with main (4c35096)

Open in CodSpeed

@myromartsin
myromartsin merged commit 9bc7098 into main Sep 1, 2026
19 checks passed
@myromartsin
myromartsin deleted the fix/digit-less-backspace-caret branch September 1, 2026 16:21
@myromartsin myromartsin mentioned this pull request Sep 1, 2026
4 tasks
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.

A digit-less backspace renders the caret at the previous edit's position

1 participant