Esri / calcite-design-system

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

Add ability to check a form component's validity for setting custom messages #9229

Closed benelan closed 6 months ago

benelan commented 6 months ago

Check existing issues

Description

Add a way to check the ValidityState of a component so custom validation messages can be set based on different constraints. The implmentation will be switched to use elementInternals once it has full support (#8126).

Acceptance Criteria

The following items are required:

Relevant Info

No response

Which Component

Form associated components

Example Use Case

https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#complex_constraints_using_the_constraint_validation_api

Priority impact

p2 - want for current milestone

Calcite package

Esri team

Calcite (dev)

github-actions[bot] commented 6 months ago

Installed and assigned for verification.

Edit: You can use this codepen for testing once a next version releases (it will throw errors until then).

geospatialem commented 6 months ago

Verified in 2.8.0-next.19 with Ben's codepen using the validityStates. 🎉