Skip to content

Commit

Permalink
fix: make text area auto-sizing stable (CP: 23.5) (#8215)
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker authored Nov 22, 2024
1 parent 42b9cb7 commit 07a0c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/text-area/src/vaadin-text-area.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ export class TextArea extends ResizeMixin(PatternMixin(InputFieldMixin(ThemableM
// position while resetting the textareas height. If the textarea had a large height, then removing its height
// will reset its height to the default of two rows. That might reduce the height of the page, and the
// browser might adjust the scroll position before we can restore the measured height of the textarea.
inputField.style.display = 'block';
inputField.style.height = inputFieldHeight;

// Fix the input element width so its scroll height isn't affected by host's disappearing scrollbars
input.style.maxWidth = inputWidth;

// Clear the height of the textarea to allow measuring a reduced scroll height
input.style.alignSelf = 'flex-start';
input.style.height = 'auto';
}
this._oldValueLength = valueLength;
Expand All @@ -323,7 +323,7 @@ export class TextArea extends ResizeMixin(PatternMixin(InputFieldMixin(ThemableM

// Restore
input.style.removeProperty('max-width');
inputField.style.removeProperty('display');
input.style.removeProperty('align-self');
inputField.style.removeProperty('height');
inputField.scrollTop = scrollTop;
}
Expand Down

0 comments on commit 07a0c32

Please sign in to comment.