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
Repurposing a DOMElement leaves existing/previous classes/attributes/properties intact, e.g:
or as a pseudo-test (can I submit PRs just for tests? :))
varFamousEngine=require('famous/core/FamousEngine');varDOMElement=require('famous/dom-renderables/DOMElement');varscene=FamousEngine.createScene('body');varclock=FamousEngine.getClock();FamousEngine.init();varnode1=scene.addChild();vardomElement1=newDOMElement(node1);domElement1.addClass('myClass');clock.setTimeout(function(){// node1.removeComponent(domElement1);scene.removeChild(node1);varnode2=scene.addChild();vardomElement2=newDOMElement(node2);clock.setTimeout(function(){// fail/false in 0.5.2 -> 0.7, pass with PR#266console.log('test pass:',!document.querySelector('[data-fa-path="body/0"]').className.match(/\bmyClass\b/));},17);},17);
Note: unnoticeable without the setTimeout.
Fixed in 0.6.In DOMElement.onDismount, we recycle the element by (amongst other things), setting display: none and leaving it attached to the DOM. But the plane is still visible on WebGL animations:
at least in Chrome stable 43 and beta 44. cc: @trusktr. Confirming that display: none is set (you can see the contents and background color all disappear).
Should node.removeComponent(domElement) do any of the stuff that DOMElement.onDismount does? i.e. recycle the domElement.
What is the expected behaviour if we call removeComponent with and/or without removing the node too?
Repurposing a DOMElement leaves existing/previous classes/attributes/properties intact, e.g:
or as a pseudo-test (can I submit PRs just for tests? :))
Note: unnoticeable without the setTimeout.
Fixed in 0.6.
InDOMElement.onDismount, we recycle the element by (amongst other things), settingdisplay: noneand leaving it attached to the DOM. But the plane is still visible on WebGL animations:at least in Chrome stable 43 and beta 44. cc: @trusktr. Confirming that.display: noneis set (you can see the contents and background color all disappear)Should
node.removeComponent(domElement)do any of the stuff thatDOMElement.onDismountdoes? i.e. recycle the domElement.What is the expected behaviour if we call removeComponent with and/or without removing the node too?