Skip to content

Commit 07a0c32

Browse files
authored
fix: make text area auto-sizing stable (CP: 23.5) (#8215)
1 parent 42b9cb7 commit 07a0c32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,13 @@ export class TextArea extends ResizeMixin(PatternMixin(InputFieldMixin(ThemableM
305305
// position while resetting the textareas height. If the textarea had a large height, then removing its height
306306
// will reset its height to the default of two rows. That might reduce the height of the page, and the
307307
// browser might adjust the scroll position before we can restore the measured height of the textarea.
308-
inputField.style.display = 'block';
309308
inputField.style.height = inputFieldHeight;
310309

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

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

324324
// Restore
325325
input.style.removeProperty('max-width');
326-
inputField.style.removeProperty('display');
326+
input.style.removeProperty('align-self');
327327
inputField.style.removeProperty('height');
328328
inputField.scrollTop = scrollTop;
329329
}

0 commit comments

Comments
 (0)