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

add maxlength attribute to input to accept maxLength prop #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chiester
Copy link

Added the ability to pass a maxLength attribute so the length of the input in SimpleSelect can be limited.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.66% when pulling 3a7c3ea on chiester:add-maxlength-attr-to-input into 2f6be3b on furqanZafar:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.66% when pulling 98e3c8c on chiester:add-maxlength-attr-to-input into 2f6be3b on furqanZafar:master.

@ameno-
Copy link

ameno- commented May 31, 2017

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
Copy link
Contributor

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).

Copy link
Author

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

Copy link
Contributor

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.

Copy link
Author

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.

@elisherer
Copy link
Contributor

With the PR I did (#160) it will be solved by passing inputProps.maxLength.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants