Skip to content

components: Add baseline validation to NumberControl #33291

@sarayourfriend

Description

@sarayourfriend

What problem does this address?

It's currently possible to input invalid values into the NumberControl: #33285

To prevent this, you currently have to manage that in the onChange you pass. But we should be able to introspect into the min and max values at minimum to create a generic validation function which prevents invalid values from being entered.

What is your proposed solution?

Using the min and max props, verify that the input value is between those numbers, inclusive of both (to match the HTML API).

Metadata

Metadata

Labels

Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Package] Components/packages/components[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions