Skip to content

Commit 4f5d1e6

Browse files
Merge pull request #48 from Detaysoft/next
Next 0.7.2
2 parents b7f96c2 + 7bb6ba6 commit 4f5d1e6

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ this.refs.input.clear();
242242
| leftButtons | none | object(component) | left buttons component |
243243
| rightButtons | none | object(component) | right buttons component |
244244
| inputRef | none | function | input or textarea ref |
245+
| maxlength | none | int | input or textarea maxlength |
245246

246247

247248
## Button Component

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-chat-elements",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"description": "Reactjs chat components",
55
"author": "Avare Kodcu <abdurrahmaneker58@gmail.com>",
66
"main": "dist/main.js",

src/Input/Input.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export class Input extends Component {
1313
}
1414

1515
onChange(e) {
16+
if (this.props.maxlength && (e.target.value || '').length > this.props.maxlength)
17+
return;
18+
1619
this.setState({
1720
value: e.target.value
1821
});
@@ -123,6 +126,7 @@ Input.defaultProps = {
123126
autoHeight: true,
124127
inputStyle: null,
125128
inputRef: null,
129+
maxlength: null,
126130
};
127131

128132
export default Input;

0 commit comments

Comments
 (0)