feat: smart deletion across separators + min/max bounds (0.4.0)#7
Merged
Conversation
- adjustDeleteCaret: Backspace/Delete next to a group separator now deletes the adjacent digit in one keystroke. Previously the keystroke deleted the separator, the reformat put it back, and the caret just drifted — the digit died on the second press. The keydown handler moves the caret past the separator so the browser's default action lands on the digit; wired automatically in bind() and both components, exported for custom use. Suppressed mid-IME-composition. - clamp / min / max (data-numkey-min / data-numkey-max): bounds applied on blur only — clamping mid-keystroke would make 50 untypeable in a min-10 field. Applies to the Korean-shorthand settle path too (1.5억 with max 100만 clamps to 1,000,000). Transient states pass through. - version 0.4.0, bilingual CHANGELOG, README rows; roadmap now down to Indian lakh grouping 86 tests (11 new). Real-browser check: keydown at '1,|234,567' moves the caret past the comma and the default deletion yields '234,567' in one keystroke; min-10 field accepts a mid-typing '5' and settles to 10 on blur.
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.
What / 무엇
입력 UX 마무리 2종 + 0.4.0 bump.
스마트 삭제 —
adjustDeleteCaret구분자 옆 Backspace/Delete가 한 번에 인접 숫자를 지웁니다. 기존엔 콤마를 지우면 재포맷이 되살려서 커서만 왼쪽으로 밀리고 숫자는 두 번째 키에서야 죽었죠 (imask도 같은 동작 — 이제 numkey가 더 나음). keydown에서 커서를 구분자 너머로 옮겨 브라우저 기본 삭제가 숫자에 닿게 하는 방식 — bind()와 Vue/React 컴포넌트에 자동 연결, IME 조합 중엔 비활성.
min / max — blur에만 적용되는 범위 제한
입력 도중엔 절대 간섭 안 함 (min 10 필드에 50을 치려면 5를 거쳐야 하니까). 만/억 축약 settle 경로에도 적용 (
1.5억+ max 100만 →1,000,000).clamp(canonical, opts)순수 함수로도 export.Verification / 검증
1,|234,567에서 실제 keydown → 커서 이동 → 기본 삭제로234,567한 방 완성 / min-10 필드에5타이핑 유지 → blur10확인머지 후 dispatch로 v0.4.0 릴리스합니다. 이후 numkey 로드맵은 인도식 lakh 그룹핑 하나만 남습니다.