Added onIsEmptyChanged prop

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-02-12 15:16:07 +01:00
parent c9f5c90047
commit 17f09d3b7a
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -117,6 +117,7 @@ export default class SendMessageComposer extends React.Component {
placeholder: PropTypes.string,
permalinkCreator: PropTypes.object.isRequired,
replyToEvent: PropTypes.object,
onIsEmptyChanged: PropTypes.func,
};
static contextType = MatrixClientContext;
@ -534,10 +535,15 @@ export default class SendMessageComposer extends React.Component {
}
}
onChange = () => {
this.props.onIsEmptyChanged(this.model.isEmpty);
}
render() {
return (
<div className="mx_SendMessageComposer" onClick={this.focusComposer} onKeyDown={this._onKeyDown}>
<BasicMessageComposer
onChange={this.onChange}
ref={this._setEditorRef}
model={this.model}
room={this.props.room}