Esri / calcite-design-system

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

[Textarea] Add support for preventing further input if it exceeds the maxlimit #10175

Open mpriour opened 1 month ago

mpriour commented 1 month ago

Check existing issues

Description

Add a property to the calcite-textarea component that when true will prevent a user from adding more text to the component when the maxlength value is exceeded. This is required to have true compatibility with the deprecated calcite-input with type="textarea" component and to mimic behavior of the native textarea element.

Acceptance Criteria

With the attribute present / set to true, further input into the textarea which would add text beyond the maxlength is prevented. Additionally if one pasted text into the textarea when this attribute is present, the pasted input would be truncated to the maxlength. If no maxlength attribute is set, then this new attribute would not do anything. These 2 input behaviors would mimic the native textarea behavior and the input behavior of the calcite-input with type="textarea"

Relevant Info

Which Component

textarea

Example Use Case

No response

Priority impact

impact - p2 - want for an upcoming milestone

Calcite package

Esri team

ArcGIS Online

mpriour commented 1 month ago

Happy to impliment this and make a PR if some decision is made as to what the new attribute would be called. limitInput is my suggestion.