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
{{ message }}
Repository navigation
Vaadin text area is unusable in firefox with large amounts of text. #452
Vaadin text area is broken in firefox when using backspace with large amounts of text.
Minimal reproducible example
Download vaadin my-starter-project
On the home view, add a textarea to the content panel.
Perform the steps in this screencast.
a. Populate the text area with a large amount of text.
b. Scroll near the bottom.
c. Attempt to delete a character using the backspace key. After hitting the backspace key once, the screen jumps up, making further text entry extremely difficult. The issue is specific to firefox and the vaadin text area component. The html textarea tag is not affected, so it is likely to do with the vaadin styling attached to the text area.
Issue hasn't been fixed and now happens in chrome. The scroll happens when this line is executed.
this.value = e.target.value;
This ends up triggering _updateHeight() in vaadin-text-area.js, which calls input.style.height = 'auto'; in a special case where content is deleted, which causes the unexpected scroll events (testing in osx / latest chrome). Removing the height = auto line makes the text area perform normally. @tomivirkki could you take another look at this?
The issue also only occurs in certain situations. When the input is set to auto, it shrinks to only a few px tall. If the page has offscreen content at that point (e.g. more scrollable content), the text area will behave correctly. If the height = auto assignment causes the screen to hit the bottom of the page, the bug occurs (in firefox and chrome). Basically, the bug happens on mostly on pages with limited amounts of other content, where the height = auto assignment causes us to hit the bottom of the page and thus lose scroll height information we need for updateHeight() to function properly.
In my testing removing the height = auto assignment fixes everything, but I don't really have the insight to say why it was included originally.
Hi @jsalts, if there's a regression or a related bug, please open a new GH issue (and reference this one) so it gets triaged properly. This one has already been closed/archived.
Activity
web-padawan commentedon Dec 3, 2020
Possibly related: angular/material#3070
jsalts commentedon Dec 7, 2020
FWIW setting max-height does help, but only if the max-height is less than 350px. In our use case we prefer to have larger sizes for the text area.
jsalts commentedon Apr 29, 2021
Issue hasn't been fixed and now happens in chrome. The scroll happens when this line is executed.
this.value = e.target.value;This ends up triggering _updateHeight() in vaadin-text-area.js, which calls
input.style.height = 'auto';in a special case where content is deleted, which causes the unexpected scroll events (testing in osx / latest chrome). Removing the height = auto line makes the text area perform normally. @tomivirkki could you take another look at this?https://github.com/vaadin/vaadin-text-field/blob/671a849c996f4b6728f28a39966add9df9e4d920/src/vaadin-text-area.js#L196
The issue also only occurs in certain situations. When the input is set to auto, it shrinks to only a few px tall. If the page has offscreen content at that point (e.g. more scrollable content), the text area will behave correctly. If the height = auto assignment causes the screen to hit the bottom of the page, the bug occurs (in firefox and chrome). Basically, the bug happens on mostly on pages with limited amounts of other content, where the height = auto assignment causes us to hit the bottom of the page and thus lose scroll height information we need for updateHeight() to function properly.
In my testing removing the height = auto assignment fixes everything, but I don't really have the insight to say why it was included originally.
tomivirkki commentedon Apr 29, 2021
Hi @jsalts, if there's a regression or a related bug, please open a new GH issue (and reference this one) so it gets triaged properly. This one has already been closed/archived.