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

Sticky header fails to resize with table #235

Closed
StephenCWills opened this issue Apr 7, 2016 · 1 comment
Closed

Sticky header fails to resize with table #235

StephenCWills opened this issue Apr 7, 2016 · 1 comment

Comments

@StephenCWills
Copy link

StephenCWills commented Apr 7, 2016

The issue as described by pull request #226.

Ran into issues where the stickyHeader would not resize when the puidatatable's width changed as the result of a scrollbar appearing or disappearing, for instance when the number of rows in the data table changes.

To replicate, apply "overflow-y: auto" to the style of the div containing the puidatatable. If there is enough data in the table to make the scrollbar appear, the sticky header's width will have been calculated incorrectly.

http://jsfiddle.net/staphen/1ez0motc/

FYI, I believe this issue is not limited to times when the scrollbar appears and disappears. The core of the problem is that the sticky header only resizes when the window resizes, not when the data table resizes. Programmatically changing the width of the containing div will also cause the table to resize without resizing the sticky header.

@StephenCWills
Copy link
Author

StephenCWills commented Apr 27, 2016

Using the latest code (032bdbd) it seems the sticky header size is calculated correctly when the puidatatable is initialized. However, there is still a problem when the data is updated after initialization. It's worth noting that in my case, I am not programmatically updating the size of the container div, but rather the number of rows in the data table. The following jsfiddle is a better representation of the issue.
http://jsfiddle.net/staphen/bc2q85n4/

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

1 participant