Skip to content

Commit 4b435ee

Browse files
Merge pull request #71 from Detaysoft/next
Next 10.0.3
2 parents 394df70 + 36ef646 commit 4b435ee

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

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": "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",

src/Input/Input.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

132136
export default Input;

0 commit comments

Comments
 (0)