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.
Live example: http://jsbin.com/nuquv/1/edit?html,js,console
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?
\cc @dfilatov
BEM.DOM.destruct()ofi-bem__domdestructs 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
zooois still handlinginput'sblurevent, regardless the fact that it's instance has been destroyed already (there is nothis._pppprop in instance). At the same time,zooois 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__domversion we could usethis.hasMod('js', 'inited')for this cases. May be we could add something similar to bem-bl's one?\cc @dfilatov