Skip to content

Commit

Permalink
fix(number-input): fix backspace
Browse files Browse the repository at this point in the history
  • Loading branch information
srflp committed Oct 7, 2023
1 parent 9059228 commit 5a5fc59
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/machines/number-input/src/number-input.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function connect<T extends PropTypes>(state: State, send: Send, normalize
try {
const { selectionStart, selectionEnd, value } = event.currentTarget

const nextValue = value.slice(0, selectionStart!) + (event as any).data + value.slice(selectionEnd!)
const nextValue = value.slice(0, selectionStart!) + ((event as any).data ?? "") + value.slice(selectionEnd!)
const isValid = state.context.parser.isValidPartialNumber(nextValue)

if (!isValid) {
Expand Down

0 comments on commit 5a5fc59

Please sign in to comment.