]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix caption lost issue related to focus changing (#12967)
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Mon, 10 Feb 2014 13:57:20 +0000 (15:57 +0200)
committerTeemu Suo-Anttila <teemusa@vaadin.com>
Mon, 10 Feb 2014 13:57:20 +0000 (15:57 +0200)
Change-Id: I2c3843c078e72dc1f394b28ea7669cc232e1e739

client/src/com/vaadin/client/ui/orderedlayout/Slot.java

index 37a97f3399db6743ff37fa2c11c5f0aa2479cc9a..efa19895a8d9480c0f2b17d9f19ddd889868eac3 100644 (file)
@@ -474,7 +474,8 @@ public final class Slot extends SimplePanel {
 
                 // Made changes to DOM. Focus can be lost if it was in the
                 // widget.
-                focusLost = widget.getElement().isOrHasChild(focusedElement);
+                focusLost = (focusedElement == null ? false : widget
+                        .getElement().isOrHasChild(focusedElement));
             }
         } else if (caption != null) {
             orphan(widget);
@@ -485,7 +486,8 @@ public final class Slot extends SimplePanel {
             captionWrap = null;
 
             // Made changes to DOM. Focus can be lost if it was in the widget.
-            focusLost = widget.getElement().isOrHasChild(focusedElement);
+            focusLost = (focusedElement == null ? false : widget.getElement()
+                    .isOrHasChild(focusedElement));
         }
 
         // Caption text