diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2020-12-18 13:16:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 13:16:26 +0200 |
commit | c8e04dc5b30f8967c58df928872ca2e5e2be5c5b (patch) | |
tree | 6aae4f933e431470906b554053f21d070fe19b97 /shared/src | |
parent | 49f70390add1655fc5eb846e7700d00cb57b5048 (diff) | |
download | vaadin-framework-c8e04dc5b30f8967c58df928872ca2e5e2be5c5b.tar.gz vaadin-framework-c8e04dc5b30f8967c58df928872ca2e5e2be5c5b.zip |
Fix to LayoutManager size calculations during transform. (#12138)
* Fix to LayoutManager size calculations during transform.
- ComputedStyle is slower but more reliable than using
getBoundingClientRect, which does not work as expected if a transform
has been applied to the element or one of its parents. This is a problem
e.g. with PopupView, where getBoundingClientRect will return too small
size (or even zero size) for all the popup contents while the opening
animation is active. ComputedStyle ignores the transform and returns the
expected value.
- The presence of the element in DOM must be checked before the size is
requested from ComputedStyle, if the element has disappeared from DOM
without a warning and calculation is attempted anyway, the browser gets
stuck.
- Possibility to configure LayoutManager to use the less reliable
calculations for applications where the slight performance difference is
more important than layout issues within elements that have transform
animations.
- Manual test, problem isn't reproducible by TestBench.
Fixes: #11187
Diffstat (limited to 'shared/src')
-rw-r--r-- | shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java b/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java index 90269a8b09..3b8f1d0a46 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java @@ -85,13 +85,22 @@ public class UIState extends AbstractSingleComponentContainerState { // Default is 1 for legacy reasons tabIndex = 1; } - /** * Enable Mobile HTML5 DnD support. * * @since 8.1 */ public boolean enableMobileHTML5DnD = false; + /** + * Should the more thorough size check be in use in LayoutManager + * calculations. If this value is changed to {@code false}, the size + * calculations can result in incorrect values if they are triggered while a + * transform animation is ongoing. This can happen e.g. when a PopupView is + * opened. + * + * @since + */ + public boolean thoroughSizeCheck = true; public static class LoadingIndicatorConfigurationState implements Serializable { |