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

Duplicate rows inserted during 'window resize' #98

Closed
yarf opened this issue Feb 20, 2017 · 3 comments
Closed

Duplicate rows inserted during 'window resize' #98

yarf opened this issue Feb 20, 2017 · 3 comments

Comments

@yarf
Copy link

yarf commented Feb 20, 2017

Bumped into the following scenario:

I have several "tab" divs in a webpage, where each tab is hidden/shown using "display: block" and "display: none". One of these tabs contains a pair of Clusterize'd tables.

When showing the tab with the table, everything operates as expected. There is one row in each. When switching to another tab (so that now Clusterize is in a 'display:none' div") and then resizing the window, a couple duplicate rows are inserted into the Clusterize'd content area. This happens to just one of the tables rather than both, yet both are identical in terms of CSS and styling ('table-layout:fixed').

Inspecting the relevant content-area/rows (in the Browser) shows this happening as soon a resize happens on the "hidden" Clusterize'd table. There are no explicit calls to update() or similar when this occurs, so I'm assuming it's related to the onresize() handler in the plugin?

Interestingly, a subsequent update() with the original single-row does not clear those additional rows either. It's like they're stuck there once created.

It does appear to be related to Clusterize being rendered inside a hidden div ...

Cheers!

@NeXTs
Copy link
Owner

NeXTs commented Feb 20, 2017

Codepen example would help a lot

@yarf
Copy link
Author

yarf commented Feb 20, 2017

http://codepen.io/anon/pen/vgoBQw

Click button at top to switch tabs; then resize window; click again to switch back and see duplicates.

Noticed this does not occur with v0.16.0, FWIW ... nor with 0.17.0

@NeXTs NeXTs closed this as completed in 973efb7 Feb 25, 2017
@yarf
Copy link
Author

yarf commented Feb 25, 2017

Thanks, though I'm afraid the commit doesn't quite address the issue effectively -- the very next call to update(), either before or after switching back from another tab, causes the same issue to occur.

http://codepen.io/anon/pen/PpwBGV

... added an update() timer at the bottom to emulate the behavior

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