Browse Source

Fix incorrect position of column selector in MPR (#11953)

Cherry pick from
https://github.com/vaadin/framework/pull/11946
tags/8.11.0.alpha1
Tatu Lund 4 years ago
parent
commit
fe46753372
No account linked to committer's email address

+ 2
- 0
client/src/main/java/com/vaadin/client/ui/VContextMenu.java View File

@@ -21,6 +21,7 @@ import java.util.Locale;
import com.google.gwt.core.client.Scheduler;
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;
@@ -155,6 +156,7 @@ public class VContextMenu extends VOverlay implements SubPartAware {
setHeight(Window.getClientHeight() + "px");
}
setPopupPosition(menuLeft, menuTop);
getElement().getStyle().setPosition(Style.Position.FIXED);

/*
* Move keyboard focus to menu, deferring the focus setting so the

+ 5
- 3
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java View File

@@ -3931,10 +3931,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);
}
}

BIN
uitest/reference-screenshots/chrome/TableTooManyColumnsTest-testDropdownTable_ANY_Chrome__init.png View File


Loading…
Cancel
Save