You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OK after more investigation, I realize it works as long as it's a new mobiledoc hash that the component has never received before.
However, if I send a default mobiledoc to the component (with an empty section, due to autofocus issue), that will cache the document as _upstreamMobiledoc. Then someone uses the editor, causing _localMobiledoc to be set. But when I want to reset the form, I resend that empty mobiledoc and it does nothing (because that default mobiledoc has been cached as _upstreamMobiledoc.
I don't know if the editor component hangs on to two references to mobiledocs for any purpose, but if not, I'd collapse _upstreamMobiledoc and _localMobiledoc into a single _mobiledoc property and that would solve the problem. PR incoming.
Activity
sdhull commentedon Dec 17, 2018
OK after more investigation, I realize it works as long as it's a new
mobiledochash that the component has never received before.However, if I send a default mobiledoc to the component (with an empty section, due to autofocus issue), that will cache the document as
_upstreamMobiledoc. Then someone uses the editor, causing_localMobiledocto be set. But when I want to reset the form, I resend that empty mobiledoc and it does nothing (because that default mobiledoc has been cached as_upstreamMobiledoc.I don't know if the editor component hangs on to two references to mobiledocs for any purpose, but if not, I'd collapse
_upstreamMobiledocand_localMobiledocinto a single_mobiledocproperty and that would solve the problem. PR incoming.sdhull commentedon Dec 17, 2018
(and turns out using
willRenderinstead ofdidReceiveAttrsis fine)