clicking anywhere in the composer pane should focus on the textarea

This commit is contained in:
Matthew Hodgson 2015-11-18 20:15:15 +00:00
parent f0df3f29b9
commit 742ae354e5

View File

@ -28,6 +28,10 @@ module.exports = React.createClass({
displayName: 'MessageComposer',
mixins: [MessageComposerController],
onInputClick: function(ev) {
this.refs.textarea.focus();
},
onUploadClick: function(ev) {
this.refs.uploadInput.click();
},
@ -60,7 +64,7 @@ module.exports = React.createClass({
<div className="mx_MessageComposer_avatar">
<MemberAvatar member={me} width={24} height={24} />
</div>
<div className="mx_MessageComposer_input">
<div className="mx_MessageComposer_input" onClick={ this.onInputClick }>
<textarea ref="textarea" rows="1" onKeyDown={this.onKeyDown} onKeyUp={this.onKeyUp} placeholder="Type a message..." />
</div>
<div className="mx_MessageComposer_upload" onClick={this.onUploadClick}>