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
vartoggle=true;m.mount(document.body,{view: function(){returnm('div',{onclick: ()=>toggle=!toggle},toggle ? 'text' : ['fragment','b'],m('br')// extra element is needed to trigger the issue)}})
I find the funny approach of putting a after a simple text hahaha.
the problem in this example is that each piece of text is considered as a pseudo element node
in the first you have "text" then in the second you have
"fragment" then "b" then when it switches for the first time it removes the first node and displays the two nodes "fragment" then "b" then when you switch for the second time it removes the first node but it leave the second because for him we replace only by a node (the first) and therefore the "b" remains.
to avoid this problem, you must surround your text with a
or other tag or you can also delete the tag in this case it will replace all the text inside the parent
Mithril.js version: v2.0.4-156-gad9aa97d
Browser and OS: Firefox on Linux.
Project:
Code
Flems
Steps to Reproduce
<div>
'b'
element from the fragment remains in the DOM after switching back to the non-fragment version.The text was updated successfully, but these errors were encountered: