Skip to content

Commit

Permalink
Merge pull request #48 from Detaysoft/next
Browse files Browse the repository at this point in the history
Next 0.7.2
  • Loading branch information
abdurrahmanekr authored Nov 27, 2017
2 parents b7f96c2 + 7bb6ba6 commit 4f5d1e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ this.refs.input.clear();
| leftButtons | none | object(component) | left buttons component |
| rightButtons | none | object(component) | right buttons component |
| inputRef | none | function | input or textarea ref |
| maxlength | none | int | input or textarea maxlength |


## Button Component
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-chat-elements",
"version": "0.7.1",
"version": "0.7.2",
"description": "Reactjs chat components",
"author": "Avare Kodcu <[email protected]>",
"main": "dist/main.js",
Expand Down
4 changes: 4 additions & 0 deletions src/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export class Input extends Component {
}

onChange(e) {
if (this.props.maxlength && (e.target.value || '').length > this.props.maxlength)
return;

this.setState({
value: e.target.value
});
Expand Down Expand Up @@ -123,6 +126,7 @@ Input.defaultProps = {
autoHeight: true,
inputStyle: null,
inputRef: null,
maxlength: null,
};

export default Input;

0 comments on commit 4f5d1e6

Please sign in to comment.