-
Notifications
You must be signed in to change notification settings - Fork 247
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
Support empty string for maxlength #595
Conversation
An input's maxlength can be an empty string, which should NOT limit typing.
Codecov Report
@@ Coverage Diff @@
## master #595 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 47 47
Lines 857 862 +5
Branches 325 327 +2
=========================================
+ Hits 857 862 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened a PR with code suggestions at Aprillion#1
fix: sanitize maxLength attribute
🎉 This PR is included in version 13.0.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What:
An input's maxlength can be an empty string, which should NOT limit typing.
Why:
Browsers work that way.
How:
Use||
instead of??
operator to convert "" into -1 instead of 0.ph-fritsche introduced a new function
getSanitizedMaxLength
to handle multiple edge casesChecklist: