Internal issue 3136 - ICDS v3 - Request for TextField 'truncateText: boolean' flag
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 63
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 15
Description
We have upgraded out typescript / React application to ICDS v3 & noticed a change in behaviour for the TextField. Note that we incorporate react-hook-form in our app to control state management between pages.
The change in v3 is;
i. if the maxCharacters is set & some text is pasted in, it now concatenates said text to that max length.
ii. when the maxCharacters is reached, it now posts a warning, rather than previously displaying a validation error message.
The cut-n-paste of text is used by our app users to copy info into the page, & then delete text to fit as required. It also affects the way we perform validation on the page as no error message is displayed. Particularly when attributes are set in the react-hook-form using urlParams to populate the Form. The text will be concatenated & the user will be unaware as said validation message will now not appear.
Can we get a new attribute to be defined for the TextField of 'truncateText: {type: boolean}'. Hence if false it will allow the text to be pasted in in full, & an error to be displayed as before. (false or not set will truncate & display a warning as the standard v3 default behaviour).
Contributor guide
Research direction
Start by locating the TextField component and its existing maxCharacters handling. Clarify the contradictory default and false-value behavior in the issue before changing anything; done should include the requested truncateText option and the corresponding full-text validation error behavior, with warning behavior preserved where specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100