React: "rowspan" attribute does not appear in DOM

Created on 14 Aug 2013  ·  9Comments  ·  Source: facebook/react

<th rowspan="2"></th> does not set rowspan in the DOM.

Component:

render: function() {
  return (
    <thead>
      <tr>
        {this.props.columns.map(this.renderColumnLabel)}
        <th rowspan="2"></th>
      </tr>
      <tr>
        {this.props.columns.map(this.renderColumnControl)}
      </tr>
    </thead>
  );
}

Output:

...
<th data-reactid=".r[5je1f].[0].[1].[1].[6].[0].[0].[1].[0].[0].[0].[1]"></th>
...

Can this be my first PR? :)

starter Bug

Most helpful comment

If you do rowSpan it'll work -- we use the camelcase version for attributes for consistency with the DOM interface where you'd do el.rowSpan = 2;. I've already opened #255 to warn when using the wrong case since lots of people get confused by this.

All 9 comments

If you do rowSpan it'll work -- we use the camelcase version for attributes for consistency with the DOM interface where you'd do el.rowSpan = 2;. I've already opened #255 to warn when using the wrong case since lots of people get confused by this.

Oh, that's it. Thanks :) I'll await #255's resolution for long term, but adjust my code in the short term...

Sorry @ericclemmons, it could have been :) I tried to do a pass for missing attributes pre-0.4 but if you notice anything missing from https://github.com/facebook/react/blob/master/src/dom/DefaultDOMPropertyConfig.js, feel free to open an issue or PR

Oh, it totally looks like rowSpan (camelCased!) is missing. I'll submit a PR...

Oops! I saw colSpan and naively assumed that rowSpan would be there too… :)

@ericclemmons Still interested in fixing this?

Closing for #291...

Given that this trips people up, instead of being consistent with the DOM, why not be consistent with HTML and support all-lowercase attributes?

I just had to go back to the docs for this issue about the "autocomplete" attribute.

I'm writing something that looks like HTML, it should work like HTML... otherwise it's an inconsistency, not consistency.

I agree. It would be preferable (to me) if attributes were all mapped .toLowerCase().

Was this page helpful?
0 / 5 - 0 ratings