Skip to content

Commit

Permalink
Make fix for input selection more robust (#84)
Browse files Browse the repository at this point in the history
* use Meteor's internal selector instead of a global jQuery

* Make the focus input event a bit more robust

* Undo accidental cut

* code style
  • Loading branch information
mrsimpson authored Aug 24, 2017
1 parent cc4bf74 commit 15a18a8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/rocketchat-ui-message/client/messageBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,12 @@ Template.messageBox.events({
},
'focus .input-message'(event, instance) {
KonchatNotification.removeRoomNotification(this._id);
chatMessages[this._id].input = instance.find('.input-message');
// Created by Vignesh on 22/08/2017
if ($('.input-message').val() !== ''){
chatMessages[this._id].input.updateAutogrow();
const input = event.target;
chatMessages[this._id].input = input;
if (event.target.value) {
instance.isMessageFieldEmpty.set(false);
return typeof input.updateAutogrow === 'function' && input.updateAutogrow();
}
// End of creation by Vignesh on 22/08/2017
},
'click .send-button'(event, instance) {
const input = instance.find('.input-message');
Expand Down

0 comments on commit 15a18a8

Please sign in to comment.