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
{{ message }}
Repository navigation
Characters from formatting count towards maxLength for Input fields #4312
Characters from formatting count towards maxLength for Input fields, this causes the count of remaining symbols to be incorrect. The following image shows an input field that should say "Du har 7 tegn igjen", it shows 0 due to formatting inserting spaces for numbers, and two punctuations.
Additionally formatting characters count towards the maxlength without accounting for characters consumed by formatting, adjusting to account for maximum length causes maxLength to initially be too large.
Correct behaviour would be to store input to formatted number separately from visual formatting, read maxLength from input while applying format visually.
Steps To Reproduce
Make blank page in altinn studio
Use input field with both formatting and maxLength
maxLength is superfluous when using "formatting", this limits the length of inputs by itself. Subtext with remaining characters still behaves strange when combining maxLength and formatting. Showing amount of remaining characters could be added as an option to "formatting".
Activity
Gunnar-Solli-Olsen commentedon Jun 30, 2026
maxLength is superfluous when using "formatting", this limits the length of inputs by itself. Subtext with remaining characters still behaves strange when combining maxLength and formatting. Showing amount of remaining characters could be added as an option to "formatting".