Skip to content

Commit 15a18a8

Browse files
authored
Make fix for input selection more robust (#84)
* use Meteor's internal selector instead of a global jQuery * Make the focus input event a bit more robust * Undo accidental cut * code style
1 parent cc4bf74 commit 15a18a8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/rocketchat-ui-message/client/messageBox.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,12 @@ Template.messageBox.events({
250250
},
251251
'focus .input-message'(event, instance) {
252252
KonchatNotification.removeRoomNotification(this._id);
253-
chatMessages[this._id].input = instance.find('.input-message');
254-
// Created by Vignesh on 22/08/2017
255-
if ($('.input-message').val() !== ''){
256-
chatMessages[this._id].input.updateAutogrow();
253+
const input = event.target;
254+
chatMessages[this._id].input = input;
255+
if (event.target.value) {
257256
instance.isMessageFieldEmpty.set(false);
257+
return typeof input.updateAutogrow === 'function' && input.updateAutogrow();
258258
}
259-
// End of creation by Vignesh on 22/08/2017
260259
},
261260
'click .send-button'(event, instance) {
262261
const input = instance.find('.input-message');

0 commit comments

Comments
 (0)