-
Notifications
You must be signed in to change notification settings - Fork 138
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
add maxlength attribute to input to accept maxLength prop #108
base: master
Are you sure you want to change the base?
Conversation
3a7c3ea
to
98e3c8c
Compare
Any chance this'll get merged @furqanZafar? It's a useful attr and the PR is pretty straightforward. |
@@ -29,6 +29,7 @@ module.exports = create-class do | |||
# class-name :: String | |||
delimiters: [] | |||
disabled: false | |||
maxLength: 255 |
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.
Why make a default limit? this is not backward compatible (i.e. Some usages may need more than 255 characters).
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.
Can't you just override the default? maxLength=1024 , or whatever
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.
You didn't understand me. If I were to use this library and happen to have values with more than 255 characters, upgrading to the version with your feature would break my code unless I specify the maxLength prop. It usually a better practice to make new features "opt-in", meaning not enforcing it unless wanted, and upgrading should not force you to make changes in your code.
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.
Thanks for the clarification. That's a good point.
With the PR I did (#160) it will be solved by passing |
Added the ability to pass a maxLength attribute so the length of the input in SimpleSelect can be limited.