andyrj / ulit

minimalist tagged template literal library, currently 3kB gzipped dependency free runtime.
MIT License
6 stars 0 forks source link

Node level issue - Walker realted? #2

Open selfup opened 6 years ago

selfup commented 6 years ago

So it seems that using a helper method for dispatching has revealed some sort of bug 🐛

`<div>
  <p>${state.num}</p>
  <button onclick=${dispatch('up')}>+</button>
  <button onclick=${dispatch('down')}>-</button>
</div>`

This works fine!

But 😢

`<div>
  ${state.num}
  <button onclick=${dispatch('up')}>+</button>
  <button onclick=${dispatch('down')}>-</button>
</div>`;

This is broken. It seems that the way the DOM is constructed matters here? 🤔

Another neat bug is here:

`<div>
  ${state.num}
  <button onclick=${dispatch('up')}>+</button>
</div>`;

😭

Now nothing fires! So there must be a level required of DOM nodes it seems

Here is the codepen for reproduction of said bugs: https://codepen.io/selfup/pen/jZjopM?editors=0010

andyrj commented 6 years ago

Working on it! Thank you for the report.