clicking anywhere in the composer pane should focus on the textarea

pull/397/head
Matthew Hodgson 2015-11-18 20:15:15 +00:00
parent f0df3f29b9
commit 742ae354e5
1 changed files with 5 additions and 1 deletions

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}>