diff options
author | Henri Sara <hesara@vaadin.com> | 2015-12-21 11:44:23 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-12-21 10:45:00 +0000 |
commit | 9dbaab1898a62a0eb94e70437e876ca80a5ee591 (patch) | |
tree | c9531d6436a1473f056671fbb990e2b645a6ae60 /client | |
parent | a20b178dda71fa6a60db322d90e63bfa9d43f9d2 (diff) | |
download | vaadin-framework-9dbaab1898a62a0eb94e70437e876ca80a5ee591.tar.gz vaadin-framework-9dbaab1898a62a0eb94e70437e876ca80a5ee591.zip |
Ignore context click on resize handle (#19408)
Otherwise, context clicks in the left edge of a header cell get
handled by the wrong cell.
Change-Id: I08e0c6bb62c90cc871fde7ec1d0f0a8602e5631f
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/connectors/GridConnector.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/connectors/GridConnector.java b/client/src/com/vaadin/client/connectors/GridConnector.java index 0b485a8e5a..1097a2f277 100644 --- a/client/src/com/vaadin/client/connectors/GridConnector.java +++ b/client/src/com/vaadin/client/connectors/GridConnector.java @@ -1186,6 +1186,12 @@ public class GridConnector extends AbstractHasComponentsConnector implements @Override protected void sendContextClickEvent(MouseEventDetails details, EventTarget eventTarget) { + // if element is the resize indicator, ignore the event + if (isResizeHandle(eventTarget)) { + WidgetUtil.clearTextSelection(); + return; + } + EventCellReference<JsonObject> eventCell = getWidget().getEventCell(); Section section = eventCell.getSection(); @@ -1202,6 +1208,16 @@ public class GridConnector extends AbstractHasComponentsConnector implements WidgetUtil.clearTextSelection(); } + private boolean isResizeHandle(EventTarget eventTarget) { + if (Element.is(eventTarget)) { + Element e = Element.as(eventTarget); + if (e.getClassName().contains("-column-resize-handle")) { + return true; + } + } + return false; + } + /** * Creates a concatenation of all columns errors for Editor. * |