marko-js-archive / marko-widgets

[LEGACY] Module to support binding of behavior to rendered UI components rendered on the server or client
http://v3.markojs.com/docs/marko-widgets/
MIT License
141 stars 40 forks source link

Bug preventing widgets from being initialized after each async fragment #106

Closed abiyasa closed 8 years ago

abiyasa commented 8 years ago

For progressive rendering, I tried to use <init-widgets immediate/> and moved the <lasso-body /> to the top of HTML, but unfortunately it didn’t work. The Widgets are initialized after the DOM ready event, instead of the end of async fragment.

I tried to run https://github.com/marko-js-samples/marko-progressive-rendering on my local machine but the widgets are also not initialized earlier. The widget behaviors are always attached after the DOM ready event despite of the options we chose. This is quite weird since it works properly on the demo (https://marko-progressive-rendering.herokuapp.com/).

patrick-steele-idem commented 8 years ago

Thanks for opening the issue @abiyasa. The logic for looking up the widgets context for each completed async fragment was incorrect. This resulted in widgets not being initialized until the final chunk (where the logic was correct).

The issue has been fixed.

New version published: marko-widgets@5.0.6

Please let me know if you find any issues with the latest version. Thanks again!

abiyasa commented 8 years ago

Thanks @patrick-steele-idem for fixing the bug. I've updated the marko-progressive-rendering to use v5.0.6 and it works now :+1: