enyo.List producing duplicate ids

edited September 2012 in Enyo 2
Is this by design?

HTML5 spec says these should be unique within the DOM[1]. Repeater appears to properly assign these but List uses the same identifier for each row.

[1] http://www.w3.org/TR/html5/global-attributes.html#the-id-attribute

Comments

  • Yeah, this is by design... but I don't like it. The reason the list does this is because of the flyweight pattern where there's only ever one set of Enyo controls created for each list, and it's used to stamp out innerHTML text for DOM elements as needed.

    I'd actually be really happy to see code that just inhibited ID attribute output for the elements in a flyweight, since you can't reliably access them after creation due to the duplicate problem. In the flyweight repeater code, it actually uses the synthetic index property (which really should be data-index!) to find the row, so IDs just aren't being used there.
Sign In or Register to comment.