-
Notifications
You must be signed in to change notification settings - Fork 150
Ignore mutation events from within atoms #343
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
Conversation
|
If this is good, we might need to do the same for cards as they are inserted in the same way using wormholes in ember-mobiledoc-editor? |
e12986c to
63bd4bb
Compare
ember-mobiledoc-editor uses ember-wormhole to insert components into atom placeholders. This immediately causes a mutation and then the editor update is triggered when nothing has changed. Atoms are their own world and so any changes in them should be safe to ignore.
63bd4bb to
192d626
Compare
|
Failure is saucelabs |
|
Thanks for this, makes total sense to me. I am wondering if it would be easier to delegate the responsibility to the render node the way we do for sections with |
|
Makes sense for this to be a renderNode concern, I'll take a look at that |
|
|
||
| function closest(el, selector, contentOnly=false) { | ||
| if (!isElementNode(el)) { | ||
| el = el.parentElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be el = el.parentNode in order for IE to pass. IE doesn't define parentElement on Node, only on Element (and a textNode is a Node but not an Element). (Thanks a lot, IE.)
|
@rlivsey I added a few comments. This looks good to me. I will do a mini spike to try finding a render node (instead of a section render node) for the mutations to check the feasibility of simply delegating the |
|
@bantic thanks, I'll make those tweaks later tonight |
|
@rlivsey When you have a chance could you test this branch out? Moving reparsing logic onto the render nodes seems to work reasonably well: |
|
@rlivsey Ping. Did you have a chance to check out the spike on the branch I mentioned before? If that works I'd be happy to fold it in and finish up work here. Would love to get this merged. |
ember-mobiledoc-editor uses ember-wormhole to insert components into
atom placeholders. This immediately causes a mutation and then
the editor update is triggered when nothing has changed.
Atoms are their own world and so any changes in them should be safe
to ignore.