Now that Object.observe()
is on by default in Chrome, I'm running into a bunch of cases where I want to reuse the browser's built in property (hidden
, title
, draggable
), but *Changed
watchers no longer get called when the property changes.
One example is hidden
: http://jsbin.com/jizikaje/1/edit (hiddenChanged()
is never called)
My current workaround is to use attributeChanged()
to observe the attribute changing:
attributeChanged: function(attrName, oldVal, newVal) {
// Cannot use *Changed watchers for these native properties.
if (attrName == 'hidden') {
this.marker.setVisible(!this.hidden);
}
}
What is the recommended approach?
BTW, throwing a warning when trying to use native properties will go a long for debugging: https://github.com/Polymer/polymer/issues/379