Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(text-area): add support for minLength #10970

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

Elijbet
Copy link
Contributor

@Elijbet Elijbet commented Dec 4, 2024

Related Issue: #8626

Summary

Add support for minlength to text-area.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Dec 4, 2024
@Elijbet Elijbet marked this pull request as ready for review December 4, 2024 21:52
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

Looking great @Elijbet! 🌮

Just a few minor suggestions.

@@ -1,4 +1,5 @@
{
"invalid": "Invalid",
"tooLong": "The current character length is {currentLength}, which exceeds the maximum character length of {maxLength}."
"tooLong": "The current character length is {currentLength}, which exceeds the maximum character length of {maxLength}.",
"tooShort": "The current character length is {currentLength}, which is less than the minimum character length of {minLength}."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@geospatialem could you review the string wording?

Copy link
Member

Choose a reason for hiding this comment

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

Awesome, @Elijbet - wording LGTM! 🚀

@jcfranco jcfranco changed the title feat(text-area): add support for minlength to text-area feat(text-area): add support for minLength Dec 11, 2024
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

Had a few comments, but this looks great, @Elijbet!

Can you also add a screenshot test? We can tweak the Exceeding Max Length Test Only story to include both min and max tests (along with proper rename).

ariaLabel={getLabelText(this)}
autofocus={this.el.autofocus}
class={{
[CSS.textArea]: true,
[CSS.readOnly]: this.readOnly,
[CSS.textAreaInvalid]: this.isCharacterLimitExceeded(),
[CSS.textAreaInvalid]:
this.isCharacterOverMaxLimit() || this.isCharacterUnderMinLimit(),
Copy link
Member

Choose a reason for hiding this comment

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

Let's DRY this up by storing and reusing the results of isCharacterOverMaxLimit() and isCharacterUnderMinLimit() within this render method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants