vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
470 stars 83 forks source link

fix: make text area auto-sizing stable #8207

Closed sissbruecker closed 4 hours ago

sissbruecker commented 22 hours ago

The auto-sizing mechanism of <vaadin-text-area> is currently not stable when the component switches from three rows to two rows. In that case subsequent _updateHeight calls can determine alternating content heights for the same value. In combination with the resize observer that the component uses that can end in an infinite resize loop, but the issue is also noticable without the resize observer when removing characters one by one.

This change makes the mechanism stable so that multiple _updateHeight calls in succession will determine the same height.

Fixes https://github.com/vaadin/web-components/issues/7828

sonarcloud[bot] commented 4 hours ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

vaadin-bot commented 3 hours ago

Hi @sissbruecker and @web-padawan, when i performed cherry-pick to this commit to 23.5, i have encountered the following issue. Can you take a look and pick it manually? Error Message: Error: Command failed: git cherry-pick 71f2c398a569411833f4366768f5ace23aa690c9 error: could not apply 71f2c398a5... fix: make text area auto-sizing stable (#8207) hint: After resolving the conflicts, mark them with hint: "git add/rm ", then run hint: "git cherry-pick --continue". hint: You can instead skip this commit with "git cherry-pick --skip". hint: To abort and get back to the state before "git cherry-pick", hint: run "git cherry-pick --abort".