-
Notifications
You must be signed in to change notification settings - Fork 12
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
Mutating a card’s payload re-triggers init
and didInsertElement
#19
Comments
@dtetto Thanks for reporting. I have a repro locally and am working on a fix. |
bantic
added a commit
that referenced
this issue
Oct 13, 2016
Also: refactor tests to use functions that generate mobiledocs
bantic
added a commit
that referenced
this issue
Oct 13, 2016
fix released in v0.5.3 |
lukemelia
pushed a commit
to yapplabs/ember-mobiledoc-dom-renderer
that referenced
this issue
Aug 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To duplicate, create a mobiledoc containing a single card whose component is:
Each time the component is clicked, the
init
anddidInsertElement
hooks are re-triggered, presumably because of a feedback loop caused by modifying the mobiledoc itself (thus triggering a re-initialization and rendering of its child cards). The expected behavior (per Ember lifecycle & DDAU) would be for subsequent re-renders to only trigger thedidUpdateAttrs
hook (or, less intuitively, to destroy the component and create a new component & context, but that’s not the case currently aswillDestroyElement
is never called).This lead to some looping behavior in the wild at (private repo): https://github.com/bustlelabs/nighthawk/issues/219.
Passing all payloads through the
(readonly)
helper:https://github.com/bustlelabs/nighthawk/commit/046c033d81683ac30f30ae3ec017cf095bab75da
is one way to address this issue.
The text was updated successfully, but these errors were encountered: