Skip to content

feat: smart deletion across separators + min/max bounds (0.4.0)#7

Merged
jlc488 merged 1 commit into
mainfrom
feature/smart-delete-min-max
Jul 17, 2026
Merged

feat: smart deletion across separators + min/max bounds (0.4.0)#7
jlc488 merged 1 commit into
mainfrom
feature/smart-delete-min-max

Conversation

@jlc488

@jlc488 jlc488 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What / 무엇

입력 UX 마무리 2종 + 0.4.0 bump.

스마트 삭제 — adjustDeleteCaret

구분자 옆 Backspace/Delete가 한 번에 인접 숫자를 지웁니다. 기존엔 콤마를 지우면 재포맷이 되살려서 커서만 왼쪽으로 밀리고 숫자는 두 번째 키에서야 죽었죠 (imask도 같은 동작 — 이제 numkey가 더 나음). keydown에서 커서를 구분자 너머로 옮겨 브라우저 기본 삭제가 숫자에 닿게 하는 방식 — bind()와 Vue/React 컴포넌트에 자동 연결, IME 조합 중엔 비활성.

min / max — blur에만 적용되는 범위 제한

<input data-numkey data-numkey-min="10" data-numkey-max="100000">

입력 도중엔 절대 간섭 안 함 (min 10 필드에 50을 치려면 5를 거쳐야 하니까). 만/억 축약 settle 경로에도 적용 (1.5억 + max 100만 → 1,000,000). clamp(canonical, opts) 순수 함수로도 export.

Verification / 검증

  • typecheck ✓ · 86 tests ✓ (11 new) · build ✓
  • 실브라우저: 1,|234,567에서 실제 keydown → 커서 이동 → 기본 삭제로 234,567 한 방 완성 / min-10 필드에 5 타이핑 유지 → blur 10 확인

머지 후 dispatch로 v0.4.0 릴리스합니다. 이후 numkey 로드맵은 인도식 lakh 그룹핑 하나만 남습니다.

- 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.
@jlc488
jlc488 merged commit a4f1a76 into main Jul 17, 2026
1 check passed
@jlc488
jlc488 deleted the feature/smart-delete-min-max branch July 17, 2026 13:44
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.

1 participant