Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically changing rowSpan #3661

Closed
RudmanMario opened this issue Apr 13, 2015 · 5 comments
Closed

Dynamically changing rowSpan #3661

RudmanMario opened this issue Apr 13, 2015 · 5 comments

Comments

@RudmanMario
Copy link

I have a problem when trying to update my table. This is how my initial table looks like:

Image of initial table

So the rowspan here works fine. My "Row" table cell looks like this:

<th className="rotate header" rowSpan={this.props.tableFoo.axisY.ordinates.length}><div><span>Row</span></div></th>

So I'm looking for the length of ordinates array for axis Y and that is the number of rows which I want my "Row" cell to cover.
Then when user clicks "Add new Y ordinate", a new ordinate is pushed and table re-renders. This is the end result:
Image of final table

So for some reason, although the rowspan changes to 4 and I can see that when inspecting elements, for some reason the table cell spans only across 3 rows. Why is that? Is it a bug?
I made a fiddle so you can see the problem.

@syranide
Copy link
Contributor

Put <tbody> in your <table> and it will work (i.e. <table><tbody>).

@zpao Yet another reason to drop the optimistic traversal if you ask me (perhaps something like #2262)

@sophiebits
Copy link
Collaborator

@syranide In master we now have a warning, at least.

@syranide
Copy link
Contributor

@spicyj Fantastic :)

@RudmanMario
Copy link
Author

Thanks for the help. It is an easy fix, but I would probably never found out about it on my own. I think there should be a warning of some sort about including <tbody> in table (or maybe there is somewhere in documentation but I haven't noticed it).

@sophiebits
Copy link
Collaborator

@RudmanMario That's what I meant by my comment, sorry for being unclear – in the next release we'll warn you explicitly and suggest adding a tbody tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants