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

why there is a duplication of table ? #41

Open
realdreamer opened this issue Dec 17, 2019 · 2 comments
Open

why there is a duplication of table ? #41

realdreamer opened this issue Dec 17, 2019 · 2 comments

Comments

@realdreamer
Copy link

realdreamer commented Dec 17, 2019

I tried to using the HTML5 Table. But, it's appending a duplication of table header and table body. It makes sense for having the below one table-header and table-body within a separate table. But, I didn't understand the point of the first one. Thats creating an unnecessary issues if I pass ref to header and body. because sometimes it's returns the below table-body and sometimes above one. Even though I'm interested in the table-body (below) with the actual values.

image

Is there any way, I can avoid rendering the first table`?

@pupudu
Copy link
Owner

pupudu commented Dec 23, 2019

Hi @realdreamer Sorry for taking a bit too long to respond to the issues. I was away for a while.
...
The first table is there to measure the table content. React-window(the base library by Brain Vaughn) is based on fixed-size rows and columns by default. Hence we have to use the react-virtualized-autosizer package to measure the table dimensions. For example, if we didn't use this, we can't make the table use 100% width of a component, and will have to specify the width explicitly everytime. In fact, needing to do this is one of the primary reasons I decided to build window-table.

So chances are, the two tables will have to stay. However, if you are facing problems because of the additional table, it's likely a missing feature or a bug in window-table. It could be an issue with the way we forward refs internally. Could you explain the issue you are facing please? Then I can see what's going wrong.

@realdreamer
Copy link
Author

HI @pupudu, Thank you for reverting back.

image

I'm trying to pass ref like mentioned in the screenshot. But the problem with this issue is, when I try to access the ref element of the tableBody to measure the height, it returns the first tableBody (which is dummy for the reference purpose what you use). So, for Example if I need to get the actual height of the tableBody => tableBodyEl?.getBoundingClientRect().height it returns me the height of the first tableBody height not the actual one what I need.

Hope this helps.

Thanks in advance :)

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

2 participants