Skip to content

[Bug]: NumberField backspace gets stuck mid-unit when using style: 'unit' format options #2850

Description

@JeroenVanC

Environment

Development/Production OS: macOS 26.3.1 (Darwin 25.3.0, arm64)
Node version: v24.11.1
Package manager: pnpm@11.4.0
Reka UI version: 2.10.1
Vue version: 3.5.27
Nuxt: N/A (not a Nuxt project)
CSS framework: tailwindcss@4.1.18
Client OS: macOS 26.3.1
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-y5tkypjc?file=src%2FApp.vue

Steps to reproduce

Try backspacing from "13 min", the input will stop at "13 mi"

Describe the bug

Using NumberField (reka-ui 2.10.1) with:

:format-options="{
style: 'unit',
unit: 'minute',
unitDisplay: 'short',
}"

When the input shows "13 min" and you press Backspace repeatedly, it stops at "13 mi" — deleting the i would produce "13 m", which NumberParser.isValidPartialNumber rejects, so @beforeinput in NumberFieldInput.vue calls preventDefault() and the keystroke is silently swallowed. There's no way to backspace through the unit suffix one character at a time.

Selecting all and deleting does work (the resulting empty string passes validation), so this seems specific to incremental backspacing through the unit literal.

Is there a recommended workaround, or is this considered a bug in the partial-validation logic for unit-formatted values?

Expected behavior

No response

Context & Screenshots (if applicable)

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions