Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for minlength to <calcite-text-area> #8626

Open
2 of 6 tasks
nwhittaker opened this issue Jan 18, 2024 · 1 comment
Open
2 of 6 tasks

Add support for minlength to <calcite-text-area> #8626

nwhittaker opened this issue Jan 18, 2024 · 1 comment
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. blocked This issue is blocked by another issue. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - medium Issue is non core or affecting less that 60% of people using the library
Milestone

Comments

@nwhittaker
Copy link
Contributor

Check existing issues

Description

The native <textarea> element supports both maxlength and minlength constraints. The <calcite-text-area> component currently supports a maxlength constraint but not a minlength one. The request is to add support for a minlength constraint.

Acceptance Criteria

  • If provided, a minLength prop is passed through to the underlying <textarea> element as a minlength constraint.
  • If/when the component supports a validity state (see Esri/calcite-design-system#7413), its validity.tooShort key is true while the component's value is shorter than minLength.
  • The value's length is measured in UTF-16 code units.1

Relevant Info

No response

Which Component

text-area

Example Use Case

Specifying a minlength constraint can be necessary when constructing a form from a feature layer's FormTemplate. Field elements associated with the TextAreaInput input may be rendered as <calcite-text-area> components. As a result, the input's minLength property should be able to be applied to the component as a minlength constraint.

Priority impact

p3 - want for upcoming milestone

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

Footnotes

  1. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#minlength

@nwhittaker nwhittaker added enhancement Issues tied to a new feature or request. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jan 18, 2024
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. calcite-components Issues specific to the @esri/calcite-components package. p3 - want for upcoming milestone labels Jan 18, 2024
@geospatialem geospatialem added impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone and removed p3 - want for upcoming milestone labels May 21, 2024
@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library estimate - 3 A day or two of work, likely requires updates to tests. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. and removed needs triage Planning workflow - pending design/dev review. labels Aug 13, 2024
@geospatialem geospatialem added this to the 2024-12-17 - Dec Release milestone Sep 6, 2024
@geospatialem geospatialem removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Sep 6, 2024
@Elijbet Elijbet self-assigned this Dec 3, 2024
@Elijbet Elijbet added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Dec 3, 2024
@Elijbet
Copy link
Contributor

Elijbet commented Dec 23, 2024

Due to our implementation and a browser limitation (see below), this is blocked by #8126.
 
The main blocker is that we use hidden inputs with forms, but the way we sync the values causes minlength/maxlength to get ignored in constraint validation APIs.

* The minlength and maxlength constraints are only checked on user-provided input. They are not checked if a value is set programmatically, even when explicitly calling checkValidity() or reportValidity().

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

minlength/maxlength are always set on the hidden inputs programmatically because we have to pass the values to them from our components. And since the hidden inputs are the elements used for validation, they are not checked.

@Elijbet Elijbet added the blocked This issue is blocked by another issue. label Dec 23, 2024
@geospatialem geospatialem added 0 - new New issues that need assignment. and removed 2 - in development Issues that are actively being worked on. labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. blocked This issue is blocked by another issue. calcite-components Issues specific to the @esri/calcite-components package. enhancement Issues tied to a new feature or request. estimate - 3 A day or two of work, likely requires updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests

3 participants