Skip to content

Commit 3f8e157

Browse files
fix: make text area auto-sizing stable (#8207) (#8214)
Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
1 parent eeb2722 commit 3f8e157

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/text-area/src/vaadin-text-area-mixin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ export const TextAreaMixin = (superClass) =>
155155
// position while resetting the textareas height. If the textarea had a large height, then removing its height
156156
// will reset its height to the default of two rows. That might reduce the height of the page, and the
157157
// browser might adjust the scroll position before we can restore the measured height of the textarea.
158-
inputField.style.display = 'block';
159158
inputField.style.height = inputFieldHeight;
160159

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

164163
// Clear the height of the textarea to allow measuring a reduced scroll height
164+
input.style.alignSelf = 'flex-start';
165165
input.style.height = 'auto';
166166
}
167167
this._oldValueLength = valueLength;
@@ -173,7 +173,7 @@ export const TextAreaMixin = (superClass) =>
173173

174174
// Restore
175175
input.style.removeProperty('max-width');
176-
inputField.style.removeProperty('display');
176+
input.style.removeProperty('align-self');
177177
inputField.style.removeProperty('height');
178178
inputField.scrollTop = scrollTop;
179179
}

0 commit comments

Comments
 (0)