summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/WidgetUtil.java13
-rwxr-xr-xclient/src/main/java/com/vaadin/client/widgets/Grid.java7
2 files changed, 19 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/WidgetUtil.java b/client/src/main/java/com/vaadin/client/WidgetUtil.java
index 94439dc945..e6304343aa 100644
--- a/client/src/main/java/com/vaadin/client/WidgetUtil.java
+++ b/client/src/main/java/com/vaadin/client/WidgetUtil.java
@@ -1867,6 +1867,19 @@ public class WidgetUtil {
}
/**
+ * Returns whether the given object is a string.
+ *
+ * @param obj
+ * the object of which the type is examined
+ * @return {@code true} if the object is a string; {@code false} if not
+ * @since
+ */
+ public static native boolean isString(Object obj)
+ /*-{
+ return typeof obj === 'string' || obj instanceof String;
+ }-*/;
+
+ /**
* Utility methods for displaying error message on components.
*
* @since 8.2
diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java
index 43f85a9848..4651c534dc 100755
--- a/client/src/main/java/com/vaadin/client/widgets/Grid.java
+++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java
@@ -7528,7 +7528,12 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
boolean isElement = Element.is(n);
if (isElement) {
String className = Element.as(n).getClassName();
- if (className.contains(getStylePrimaryName() + "-spacer")) {
+
+ // Also check whether className is indeed a string. For
+ // SVGElement it may be of type SVGAnimatedString.
+ // https://developer.mozilla.org/en-US/docs/Web/API/Element/className#Notes
+ if (WidgetUtil.isString(className) && className
+ .contains(getStylePrimaryName() + "-spacer")) {
return true;
}
}