]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix incorrect position of column selector in MPR (#11946)
authorMehdi Javan <32511762+mehdi-vaadin@users.noreply.github.com>
Thu, 16 Apr 2020 08:35:51 +0000 (11:35 +0300)
committerGitHub <noreply@github.com>
Thu, 16 Apr 2020 08:35:51 +0000 (11:35 +0300)
* Change ContextMenu position from absolute to fixed

* Use getBoundingClientRect to get the coordinates of columnSelector in
VScrollTable when the context menu is being opened

* Update TableTooManyColumnsTest screenshot

* Upgrade Chrome version in VerifyBrowserVersionTest

* Update ValoThemeUITest-sliders screenshot

client/src/main/java/com/vaadin/client/ui/VContextMenu.java
client/src/main/java/com/vaadin/client/ui/VScrollTable.java
uitest/reference-screenshots/TableTooManyColumnsTest-testDropdownTable_ANY_Chrome__TableTooManyColumnsTest-testDropdownTable.png [changed mode: 0755->0644]
uitest/reference-screenshots/ValoThemeUITest-sliders_ANY_Chrome__sliders.png
uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java

index d9a29a9ec62600aaf0e5df8beadfed14e72b82ba..ffb8a21099e07b984af45af1af54145af81bab8e 100644 (file)
@@ -20,6 +20,7 @@ import com.google.gwt.core.client.Scheduler;
 import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.NodeList;
+import com.google.gwt.dom.client.Style;
 import com.google.gwt.dom.client.TableRowElement;
 import com.google.gwt.dom.client.TableSectionElement;
 import com.google.gwt.event.dom.client.BlurEvent;
@@ -166,6 +167,7 @@ public class VContextMenu extends VOverlay implements SubPartAware {
                     setHeight(Window.getClientHeight() + "px");
                 }
                 setPopupPosition(left, top);
+                getElement().getStyle().setPosition(Style.Position.FIXED);
 
                 /*
                  * Move keyboard focus to menu, deferring the focus setting so
index 1158dd1f808331b8284a6d077fa356fd97bd0538..d7494074412d09c5973d9fbe8546fee111660000 100644 (file)
@@ -3926,10 +3926,12 @@ public class VScrollTable extends FlowPanel
         public void onBrowserEvent(Event event) {
             if (enabled) {
                 if (event.getEventTarget().cast() == columnSelector) {
-                    final int left = DOM.getAbsoluteLeft(columnSelector);
-                    final int top = DOM.getAbsoluteTop(columnSelector)
+                    WidgetUtil.TextRectangle clientRect = WidgetUtil
+                            .getBoundingClientRect(columnSelector);
+                    final int left = (int) clientRect.getLeft();
+                    final int top = (int) (clientRect.getTop()
                             + DOM.getElementPropertyInt(columnSelector,
-                                    "offsetHeight");
+                                    "offsetHeight"));
                     client.getContextMenu().showAt(this, left, top);
                 }
             }
old mode 100755 (executable)
new mode 100644 (file)
index 96910b4..646555a
Binary files a/uitest/reference-screenshots/TableTooManyColumnsTest-testDropdownTable_ANY_Chrome__TableTooManyColumnsTest-testDropdownTable.png and b/uitest/reference-screenshots/TableTooManyColumnsTest-testDropdownTable_ANY_Chrome__TableTooManyColumnsTest-testDropdownTable.png differ
index 17b728014468a2e92fb5124e70cefd210267524f..26148e93ec7ac933a97abcb104a88664a86ee013 100644 (file)
Binary files a/uitest/reference-screenshots/ValoThemeUITest-sliders_ANY_Chrome__sliders.png and b/uitest/reference-screenshots/ValoThemeUITest-sliders_ANY_Chrome__sliders.png differ
index 3dd97796d17543bfbd5e740b9107b9f59bb2d9ad..21db6bd3663043f515aed8f30c20a9c92f0430c9 100644 (file)
@@ -25,7 +25,7 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest {
             // Chrome version does not necessarily match the desired version
             // because of auto updates...
             browserIdentifier = getExpectedUserAgentString(
-                    getDesiredCapabilities()) + "78";
+                    getDesiredCapabilities()) + "81";
         } else {
             browserIdentifier = getExpectedUserAgentString(desiredCapabilities)
                     + desiredCapabilities.getVersion();