You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is a <vaadin-text-area> e.g. with width: 100% so that the width of the component changes when you resize the browser window for example, some of the text content may overflow from the bottom because the height of the text area does not automatically update when the width of the component changes. When this happens the behaviour seems buggy because scroll bar does not appear in this case and the height is not updated like it would be when typing into the text area.
Workaround: Call textArea._updateHeight() after the width has changed (e.g. on windowresize event or using ResizeObserver).
When the text area has e.g. a few lines of text and the width becomes smaller (e.g. due to resizing the window to be narrower when text area has width 100%) so that the text starts wrapping to more lines, the height of the text area should automatically be expanded in the same way as it does when you type into the field.
Actual outcome
The height does not expand on width resize with overflowing text and scroll bar doesn't appear making it so that you can only scroll the text by using keyboard (e.g. arrow keys). Even if the text area already has a vertical scroll bar (like in the max-height demo) you can't scroll all the content if it wraps to more lines due to resize.
web-padawan
changed the title
Text area content may become hidden and unscrollable on resize
[text-field] Text area content may become hidden and unscrollable on resize
Jun 15, 2021
Description
When there is a
<vaadin-text-area>
e.g. withwidth: 100%
so that the width of the component changes when you resize the browser window for example, some of the text content may overflow from the bottom because the height of the text area does not automatically update when the width of the component changes. When this happens the behaviour seems buggy because scroll bar does not appear in this case and the height is not updated like it would be when typing into the text area.Workaround: Call
textArea._updateHeight()
after the width has changed (e.g. onwindow
resize
event or using ResizeObserver).See also https://stackoverflow.com/q/60675038/1362634 for more context.
Expected outcome
When the text area has e.g. a few lines of text and the width becomes smaller (e.g. due to resizing the window to be narrower when text area has width 100%) so that the text starts wrapping to more lines, the height of the text area should automatically be expanded in the same way as it does when you type into the field.
Actual outcome
The height does not expand on width resize with overflowing text and scroll bar doesn't appear making it so that you can only scroll the text by using keyboard (e.g. arrow keys). Even if the text area already has a vertical scroll bar (like in the max-height demo) you can't scroll all the content if it wraps to more lines due to resize.
Live Demo
https://cdn.vaadin.com/vaadin-text-field/2.5.4/demo/#text-area-demos
Steps to reproduce
width: 100%
gfaljfhg kas ghaf glkfaj g fa göfsah galjs hgalkjfs gfsa gljfsa gaflks gfaljs hgfa slkj gfaks lkjghfsa gkfsa hgkfsa g aflkj gljfa galkjfs glkjfsa gkjfsa gkjla glkjfsa hglkjfsa hgaslkjf gfalkjhgfalkj gfa glkjfsa hgfsalkj hgsaf hfagfa hfas lkjgfsa glkjlkjfsa hgkjfsa hgalkjfs glkjfsa hglkjfsa hgkljfsa hgkfsah
The text was updated successfully, but these errors were encountered: