PolymerElements / iron-selector

Manages a list of elements that can be selected
32 stars 55 forks source link

IronMultiSelectableBehavior: no _updateSelected() on DOM mutation #69

Closed sklobovskaya closed 8 years ago

sklobovskaya commented 8 years ago

IronMultiSelectableBehavior fails to update the selection (this._updateSelected()) when the DOM is mutated.

IronSelectableBehavior calls this._updateSelected() on DOM mutation, here:

https://github.com/PolymerElements/iron-selector/blob/master/iron-selectable.html#L295

However, when using IronMultiSelectableBehavior, the above line is never executed because IronMultiSelectableBehavior uses this.selectedValues instead, and thus this.selected is always null.

eliseosoto commented 8 years ago

The problem appears to be in IronSelectableBehavior._observeContent

https://github.com/PolymerElements/iron-selector/blob/master/iron-selectable.html#L277

var content = node.querySelector('content'); content is null

And then after an element that has IronSelectableBehavior is attached the _contentObserver is undefined.