From 529e3285036a7a9c204c357753c456d8293374a7 Mon Sep 17 00:00:00 2001 From: frankiefu Date: Mon, 21 Apr 2014 16:13:53 -0700 Subject: [PATCH] fixes #1 --- core-selector.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core-selector.html b/core-selector.html index 0035319..9e5b7f1 100644 --- a/core-selector.html +++ b/core-selector.html @@ -245,6 +245,9 @@ }, get items() { + if (!this.target) { + return []; + } var nodes = this.target !== this ? (this.itemsSelector ? this.target.querySelectorAll(this.itemsSelector) : this.target.children) : this.$.items.getDistributedNodes(); @@ -257,10 +260,12 @@ if (old) { this.removeListener(old); this.observer.disconnect(); + this.clearSelection(); } if (this.target) { this.addListener(this.target); this.observer.observe(this.target, {childList: true}); + this.updateSelected(); } },