Skip to content

Commit

Permalink
Merge pull request #8019 from RocketChat/messagebox-autogrow
Browse files Browse the repository at this point in the history
[FIX] message-box autogrow
  • Loading branch information
rodrigok committed Sep 5, 2017
1 parent ca4ce25 commit be6812e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@

cursor: text;

line-height: 20px;

transition: background-color 0.3s;

border-width: var(--message-box-container-border-width);
Expand All @@ -99,9 +101,10 @@

&__textarea {
width: 100%;
height: 15px;
max-height: 155px;

padding: 0;
height: 15px;

resize: none;

Expand Down
10 changes: 2 additions & 8 deletions packages/rocketchat-ui/client/lib/textarea-autogrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,17 @@
}

if(newHeight === $self[0].offsetHeight){
return;
return false;
}

if(maxHeight <= newHeight){
return;
newHeight = maxHeight;
}

$self.css('overflow-y', 'hidden');

$self.stop().animate( { height: newHeight }, { duration: 100, complete: ()=> {
$self.trigger('autogrow', []);
$self.css('overflow-y', '');
}});




$self.trigger('autogrow', []);

if (settings.postGrowCallback !== null) {
Expand Down

0 comments on commit be6812e

Please sign in to comment.