Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listeners on data-change events may not be called if the property is bound #3077

Closed
sorvell opened this issue Nov 23, 2015 · 1 comment
Closed
Assignees
Labels

Comments

@sorvell
Copy link
Contributor

sorvell commented Nov 23, 2015

We recently changed property sets at bind data propagation so that they avoid firing data change events. This was done as an optimization: these events are only necessary for 2-way binding and if the value is being sent from the bindor, then no notification is necessary. The problem is that users who have added event listeners for data change events (e.g. foo-change) will not be notified when the property changes due to binding. We may need to consider backing this optimization out.

@beauwest
Copy link

👍

We have this exact issue. I believe #2815 is related to this. Modifying the Polymer build and setting _useCache: false corrects it.

sorvell pushed a commit that referenced this issue Nov 30, 2015
Revert fromAbove in applyEffectValue. Add test. Fixes #3077.
kevinpschaaf added a commit that referenced this issue Jan 20, 2017
…4262.

* `Polymer.Settings.suppressTemplateNotifications `- disables `dom-change` and `rendered-item-count` events from `dom-if`, `dom-repeat`, and `don-bind`. Users can opt back into `dom-change` events by setting the `notify-dom-change` attribute (`notifyDomChange: true` property) to `dom-if`/`don-repeat` instances.
* `Polymer.Settings.suppressBindingNotifications` - disables notify effects when propagating data downward via bindings. Generally these are never useful unless users are explicitly doing something like `<my-el foo="{{foo}} on-foo-changed="{{handleFoo}}">` or calling `addEventListener('foo-changed', ...)` on an element where `foo` is bound (we attempted to make this the default some time back but needed to revert it when we found via #3077 that users were indeed doing this).  Users that avoid these patterns can enjoy the potentially significant benefit of suppressing unnecessary events during downward data flow by opting into this flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants