Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
295 stars 76 forks source link

Calcite number input: allow configuration to prevent entry of specific characters #10406

Open ade10176 opened 2 months ago

ade10176 commented 2 months ago

Check existing issues

Description

Calcite number input currently supports characters like - or e. In a min/max file attachment use case, where - is not an acceptable entry, user currently can type in - and is persisted when: • there are no numbers in the input (-) • following numbers in the input (5-)

if the user enters 5-1, the - is omitted, and the entry becomes 51

if the user enters -5, the entry is not accepted and it triggers a validation error

Acceptance Criteria

Allow configuration to prevent specific character(s) to be entered in the number input. Also welcome to workaround ideas.

Relevant Info

Field Maps Designer issue https://github.com/ArcGIS/field-apps-web/issues/4229

Which Component

calcite input number

Example Use Case

No response

Priority impact

impact - p1 - need for current milestone

Calcite package

Esri team

ArcGIS Field Apps

nCastle1 commented 1 week ago

I would also like this change for a Maps SDK for JavaScript use case. But I think the issue is more general; the numeric input should enforce the min and max values. Currently, the min/max values only appear to affect the behavior of the buttons.