Skip to content

[Feature Request]: NumberInput type="text" functional improvements #19630

@tay1orjones

Description

@tay1orjones

The problem

We've received a few points of feedback since introducing type="text" to NumberInput. These items need fixed.

The solution

  • The event value from onChange and onBlur should be a Number, not the locale-formatted string.
    • If for some reason the consumer wants the locale-formatted string, they'll need to look at the input event.target.value directly
  • When focus is on a stepper button and focus moves away from that stepper button, onBlur is not called but should be
  • When the input field is empty, clicking a stepper should reset to 0 or move a step, also taking into account min and max.
    • min/max thoughts: Incrementing from an empty input always starts at min, decrementing always starts at max. If no min or max it starts at 0

Examples

Package

@carbon/react

Metadata

Metadata

Assignees

Labels

proposal: acceptedThis request has gone through triaging and we are accepting PR's against it.proposal: active developmentThis request is actively being worked during the current sprint.type: enhancement 💡
No fields configured for Enhancement.

Projects

Status
✅ Done
Status
Completed 🚢

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions