File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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
128132export default Input ;
You can’t perform that action at this time.
0 commit comments