diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-11-20 11:26:21 +0100 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-11-20 11:26:21 +0100 |
commit | 72d92bcbbb48680244dc4cd6d07a2248297a483e (patch) | |
tree | 8196ad0b1e6f1251305ab57eac05a5037e96411a | |
parent | 46a0731a5bd6a51d0e7b80c2d596df29bc271710 (diff) | |
download | vaadin-framework-72d92bcbbb48680244dc4cd6d07a2248297a483e.tar.gz vaadin-framework-72d92bcbbb48680244dc4cd6d07a2248297a483e.zip |
Isolate text selection blocking to Grid instead of body element (#16838)
Some themes are more explicit with user-select rules, and doing this on
the level of body element does not work with said themes. To make all
the themes behave the same way, we only block selection inside of Grid.
Change-Id: Iaf24fede88e4bc683e065c214e7baf3f545c99c9
-rw-r--r-- | client/src/com/vaadin/client/widgets/Grid.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 33672517fe..3033d74867 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -36,7 +36,6 @@ import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.core.shared.GWT; import com.google.gwt.dom.client.BrowserEvents; import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.EventTarget; import com.google.gwt.dom.client.NativeEvent; @@ -5581,24 +5580,25 @@ public class Grid<T> extends ResizeComposite implements c)); } } - WidgetUtil.setTextSelectionEnabled(Document - .get().getBody(), false); + + WidgetUtil.setTextSelectionEnabled( + getElement(), false); } @Override public void onComplete() { fireEvent(new ColumnResizeEvent<T>(col)); - WidgetUtil.setTextSelectionEnabled(Document - .get().getBody(), true); + WidgetUtil.setTextSelectionEnabled( + getElement(), true); } @Override public void onCancel() { col.setWidth(initialWidth); - WidgetUtil.setTextSelectionEnabled(Document - .get().getBody(), true); + WidgetUtil.setTextSelectionEnabled( + getElement(), true); } }); dragger.addTo(td); |