File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -275,6 +275,7 @@ this.refs.input.clear();
275275| rightButtons | none | object(component) | right buttons component |
276276| inputRef | none | function | input or textarea ref |
277277| maxlength | none | int | input or textarea maxlength |
278+ | onMaxLengthExceed | none | function | called when max length exceed |
278279
279280
280281## Button Component
Original file line number Diff line number Diff line change 11{
22 "name" : " react-chat-elements" ,
3- "version" : " 10.0.2 " ,
3+ "version" : " 10.0.3 " ,
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,8 +13,11 @@ export class Input extends Component {
1313 }
1414
1515 onChange ( e ) {
16- if ( this . props . maxlength && ( e . target . value || '' ) . length > this . props . maxlength )
16+ if ( this . props . maxlength && ( e . target . value || '' ) . length > this . props . maxlength ) {
17+ if ( this . props . onMaxLengthExceed instanceof Function )
18+ this . props . onMaxLengthExceed ( ) ;
1719 return ;
20+ }
1821
1922 this . setState ( {
2023 value : e . target . value
@@ -127,6 +130,7 @@ Input.defaultProps = {
127130 inputStyle : null ,
128131 inputRef : null ,
129132 maxlength : null ,
133+ onMaxLengthExceed : null ,
130134} ;
131135
132136export default Input ;
You can’t perform that action at this time.
0 commit comments