clear input field when changing topics
This commit is contained in:
@@ -1216,6 +1216,7 @@ class MessagesView extends React.Component {
|
||||
:
|
||||
<SendMessage
|
||||
tinode={this.props.tinode}
|
||||
topicName={this.state.topic}
|
||||
noInput={!!this.props.forwardMessage}
|
||||
disabled={!this.state.isWriter || this.state.deleted}
|
||||
onKeyPress={this.sendKeyPress}
|
||||
|
||||
@@ -78,6 +78,12 @@ export default class AudioRecorder extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.stream) {
|
||||
this.cleanUp();
|
||||
}
|
||||
}
|
||||
|
||||
// Draw amplitude of sound.
|
||||
visualize() {
|
||||
this.initCanvas();
|
||||
@@ -308,7 +314,7 @@ export default class AudioRecorder extends React.PureComponent {
|
||||
return (
|
||||
<div className="audio">
|
||||
<a href="#" onClick={this.handleDelete} title="Delete">
|
||||
<i className="material-icons">delete_outline</i>
|
||||
<i className="material-icons gray">delete_outline</i>
|
||||
</a>
|
||||
{this.state.recording ?
|
||||
<canvas ref={this.canvasRef} />
|
||||
|
||||
@@ -82,7 +82,9 @@ class SendMessage extends React.PureComponent {
|
||||
this.messageEditArea.focus();
|
||||
}
|
||||
|
||||
if (prevProps.reply != this.props.reply) {
|
||||
if (prevProps.topicName != this.props.topicName) {
|
||||
this.setState({message: '', audioRec: false, quote: null});
|
||||
} else if (prevProps.reply != this.props.reply) {
|
||||
this.setState({quote: this.formatReply()});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user