Skip to content

Commit

Permalink
fix: make text area auto-sizing stable (#8207)
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker authored Nov 22, 2024
1 parent ac9ee94 commit 71f2c39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/text-area/src/vaadin-text-area-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ export const TextAreaMixin = (superClass) =>
// 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 @@ -199,7 +199,7 @@ export const TextAreaMixin = (superClass) =>

// 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 71f2c39

Please sign in to comment.