polymer: notifySplices fails to notify about changes in array of primitives
I have an array of Strings that’s being changed:
var model = {
people: [
"Alice",
"Bob"
]
};
// ...
model.people[0] = "Anna";
So, I would like to notify my dom-bind about this change using notifySplices:
domBind.notifySplices('organization.people', [{
index: 0,
removed: removed,
addedCount: 1,
object: model.people,
type: 'splice'
}]);
Live example here http://jsbin.com/kocowalimi/1/edit?html,console,output
In result, entire content of dom-repeat disappears and throws an error:
"TypeError: Cannot read property 'isPlaceholder' of undefined
at dom-repeat.Polymer._detachInstance (http://polygit.org/components/polymer/polymer.html:4415:10)
at dom-repeat.Polymer._detachAndRemoveInstance (http://polygit.org/components/polymer/polymer.html:4430:17)
at dom-repeat.Polymer._applySplicesArrayOrder (http://polygit.org/components/polymer/polymer.html:4406:6)
at dom-repeat.Polymer._render (http://polygit.org/components/polymer/polymer.html:4259:6)
at Object.Debouncer.complete (http://polygit.org/components/polymer/polymer-mini.html:2099:15)
at boundComplete (http://polygit.org/components/polymer/polymer-mini.html:2078:6)
at Object.Polymer.Async._atEndOfMicrotask (http://polygit.org/components/polymer/polymer-mini.html:2055:1)
at MutationObserver.window.MutationObserver.observe.characterData (http://polygit.org/components/polymer/polymer-mini.html:2070:15)"
If I change string names to objects like {name: "Alice"}.. it works, but I cannot change my database models, just to fit this UI.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (5 by maintainers)
This was fixed with #3970 in Polymer 2: http://jsbin.com/budocaxeru/edit?html,console,output