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
142 stars 40 forks source link

Declarative DOM event listeners broken for non-bubbling events on repeated elements #170

Closed smulder closed 7 years ago

smulder commented 7 years ago

In Marko 3.12.1 and Marko-Widgets 6.4.1 looped elements with custom event handlers in a template are getting assigned the same id and in some cases only firing the event on the first element in the group.

A temporary workaround for me has been assigning the status variable on the for loop as follows:

<div for(img in data.images | status-var=loop) id="imageHolder${loop.getIndex()" w-onMouseOver="handleSomething">

patrick-steele-idem commented 7 years ago

New version published with fix: marko-widgets@6.6.0