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
1 changed files with 5 additions and 1 deletions

View File

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