Cherry pick from https://github.com/vaadin/framework/pull/11946tags/8.11.0.alpha1
@@ -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 |
@@ -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); | |||
} | |||
} |