Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/uui-input/lib/uui-input.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class UUIInputElement extends UUIFormControlMixin(
maxlengthMessage: string | ((max: number, current: number) => string) = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this from current to exceeded is a breaking change.
We must remember we are not the only ones using the UI Library. So there may be someone who already uses this and parses in those values. So we need to have the logiv locally.
I would suggest to resolve in this way: Maximum ${max} characters, ${current-max} too many

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't think of it. I updated this issue

max,
current,
) => `Maximum length exceeded (${current}/${max} characters)`;
) => `Maximum ${max} characters, ${current - max} too many.`;

/**
* Specifies the interval between legal numbers of the input
Expand Down
2 changes: 1 addition & 1 deletion packages/uui-textarea/lib/uui-textarea.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class UUITextareaElement extends UUIFormControlMixin(LitElement, '') {
maxlengthMessage: string | ((max: number, current: number) => string) = (
max,
current,
) => `Maximum ${max} characters, ${current} too many.`;
) => `Maximum ${max} characters, ${current - max} too many.`;

@query('#textarea')
protected _textarea!: HTMLInputElement;
Expand Down
Loading