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
<!-- a comment --><p>whitespace before this element is ignored</p>
...is compiled to this...
functioncreate_main_fragment(state,component){varp;return{c: functioncreate(){p=createElement("p");p.textContent="whitespace before this element is ignored";},m: functionmount(target,anchor){insertNode(p,target,anchor);},p: noop,u: functionunmount(){detachNode(p);},d: noop};}
<:Windowbind:scrollX/>
<p>whitespace before this element is NOT ignored</p>
...is compiled to this:
functioncreate_main_fragment(state,component){varwindow_updating=false,text,p;functiononwindowscroll(event){window_updating=true;component.set({scrollX: this.scrollX});window_updating=false;};window.addEventListener("scroll",onwindowscroll);component.observe("scrollX",function(x){if(window_updating)return;window.scrollTo(x,window.scrollY);});return{c: functioncreate(){text=createText("\n\n");p=createElement("p");p.textContent="whitespace before this element is NOT ignored";},m: functionmount(target,anchor){insertNode(text,target,anchor);insertNode(p,target,anchor);},p: noop,u: functionunmount(){detachNode(text);detachNode(p);},d: functiondestroy(){window.removeEventListener("scroll",onwindowscroll);}};}
Note the text = createText("\n\n");, which also has to be mounted and detached etc.
The text was updated successfully, but these errors were encountered:
Fairly minor issue, but whereas this code...
...is compiled to this...
...this code...
...is compiled to this:
Note the
text = createText("\n\n");
, which also has to be mounted and detached etc.The text was updated successfully, but these errors were encountered: