garbles / yolk

:egg: A library for building asynchronous user interfaces.
MIT License
925 stars 32 forks source link

data-value attribute #27

Closed jadbox closed 9 years ago

jadbox commented 9 years ago

I'm using a library that I prefer not to fork that requires data-value attributes on nodes. However, it seems they are filtered out (virtualdom?). Can we support this value though some jsx propererty, for example like dataValue?

garbles commented 9 years ago

Added a note to the documentation about adding data attributes https://github.com/yolkjs/yolk#supported-attributes

geekytime commented 8 years ago

Was this broken in the rewrite? I can't get data-value attributes to show up in the DOM at all.

garbles commented 8 years ago

100% broken. Gotta add it back.

geekytime commented 8 years ago

Could we just change NodeProxy.js#L80 from:

if (!descriptor) {
      set(node, key, value)
      return
}

To:

if (!descriptor) {
      node.setAttribute(key, value);
      return;
}

Or would that break other things?

geekytime commented 8 years ago

There's also the new data api to consider, I suppose... And aria attributes (although setAttribute should work for those?)

geekytime commented 8 years ago

Meh. It also looks like it'll break other things. I've got spans rendering a textcontent attribute, etc.

garbles commented 8 years ago

This fixes the issue. Added a test for it too.