Skip to content

Commit b0f8812

Browse files
Merge pull request #73 from Detaysoft/next
Next 10.0.4
2 parents 4b435ee + 63f7b37 commit b0f8812

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ this.refs.input.clear();
276276
| inputRef | none | function | input or textarea ref |
277277
| maxlength | none | int | input or textarea maxlength |
278278
| onMaxLengthExceed | none | function | called when max length exceed |
279+
| autofocus | false | bool | input autofocus |
279280

280281

281282
## 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.3",
3+
"version": "10.0.4",
44
"description": "Reactjs chat components",
55
"author": "Avare Kodcu <abdurrahmaneker58@gmail.com>",
66
"main": "dist/main.js",

src/Input/Input.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export class Input extends Component {
4646
this.onChange(event);
4747
}
4848

49+
componentDidMount() {
50+
if (this.props.autofocus === true)
51+
this.input.focus();
52+
}
53+
4954
render() {
5055
return (
5156
<div className={classNames('rce-container-input', this.props.className)}>
@@ -131,6 +136,7 @@ Input.defaultProps = {
131136
inputRef: null,
132137
maxlength: null,
133138
onMaxLengthExceed: null,
139+
autofocus: false,
134140
};
135141

136142
export default Input;

0 commit comments

Comments
 (0)