Skip to content

Commit c4e79ad

Browse files
uui-textarea, uui-input: new max length message validation (closes Umbraco-CMS/issues/20710) (#1227)
* fix max length message for text area * fix message for input and textarea * update exceed to current --------- Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
1 parent bba223b commit c4e79ad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/uui-input/lib/uui-input.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class UUIInputElement extends UUIFormControlMixin(
126126
maxlengthMessage: string | ((max: number, current: number) => string) = (
127127
max,
128128
current,
129-
) => `Maximum length exceeded (${current}/${max} characters)`;
129+
) => `Maximum ${max} characters, ${current - max} too many.`;
130130

131131
/**
132132
* Specifies the interval between legal numbers of the input

packages/uui-textarea/lib/uui-textarea.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class UUITextareaElement extends UUIFormControlMixin(LitElement, '') {
105105
maxlengthMessage: string | ((max: number, current: number) => string) = (
106106
max,
107107
current,
108-
) => `Maximum ${max} characters, ${current} too many.`;
108+
) => `Maximum ${max} characters, ${current - max} too many.`;
109109

110110
@query('#textarea')
111111
protected _textarea!: HTMLInputElement;

0 commit comments

Comments
 (0)