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
BEM.DOM.destruct() of i-bem__dom destructs found blocks in context from first to last. This could lead to some strange effects, when block that has been removed already still is trying to handle events from nested blocks that are in a destructing phase.
Block zooo is still handling input's blur event, regardless the fact that it's instance has been destroyed already (there is no this._ppp prop in instance). At the same time, zooo is still linked to it's DOM element with this.domElem.
So there is no "official" way to handle this situation in general because we can't say is block is still a "live".
In bem-core's i-bem__dom version we could use this.hasMod('js', 'inited') for this cases. May be we could add something similar to bem-bl's one?
Actually the problem from jsbin's example is that i-bem initializes a new empty instance of input after blur event happens. As this new instance is linked to the same DOM node that already has input_js_inited class, it doesn't call onSetMod → js → inited handler, where _ppp property should be set. So we have "strange" log message in console, where this.domElem exists, but this._ppp isn't.
BEM.DOM.destruct()
ofi-bem__dom
destructs found blocks in context from first to last. This could lead to some strange effects, when block that has been removed already still is trying to handle events from nested blocks that are in a destructing phase.Live example: http://jsbin.com/nuquv/1/edit?html,js,console
Block
zooo
is still handlinginput
'sblur
event, regardless the fact that it's instance has been destroyed already (there is nothis._ppp
prop in instance). At the same time,zooo
is still linked to it's DOM element withthis.domElem
.So there is no "official" way to handle this situation in general because we can't say is block is still a "live".
In bem-core's
i-bem__dom
version we could usethis.hasMod('js', 'inited')
for this cases. May be we could add something similar to bem-bl's one?\cc @dfilatov
The text was updated successfully, but these errors were encountered: