You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Short description
This pull request fixes the issue where the `counterLimit` was not
correctly accounting for the spaces added by the `valueFormat` function
in the `TextInputBase` component. This ensures that the actual text
length (excluding spaces) is compared against the `counterLimit`.
## List of changes proposed in this pull request
- Updated the `onChangeTextHandler` to correctly handle the
`counterLimit` by calculating the actual text length without spaces
- Adjusted the `maxLength` prop of the `TextInput` component to account
for the spaces added by the `valueFormat` function
- Ensured that the `counterLimit` is respected correctly for formatted
text inputs such as `credit-card` and `iban`
## How to test
- Set a `counterLimit` in `DSTextFields`
- Insert some value in `credit-card` and `iban` `TextInput`
- Ensure that now the `counterLimit` displaying the correct number
## Preview
| Old | New |
|--------|--------|
| <video
src="https://github.com/user-attachments/assets/6449ed43-75fb-4eec-b633-2a018c7e78e8"
/> | <video
src="https://github.com/user-attachments/assets/0de2d7f0-2b01-4751-b759-a0c41108198e"/>
|
### Prevent counter updating on wrong value
| Old | New |
|--------|--------|
| <video
src="https://github.com/user-attachments/assets/bb0bab8f-bb4f-4433-aa10-f2ed1e87cfa1"
/> | <video
src="https://github.com/user-attachments/assets/7518a037-e9d4-4b48-aba8-2877b2d71e90"/>
|
0 commit comments