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

Improve tab rendering perfomance #68

Closed
HaNdTriX opened this issue May 17, 2016 · 5 comments
Closed

Improve tab rendering perfomance #68

HaNdTriX opened this issue May 17, 2016 · 5 comments

Comments

@HaNdTriX
Copy link
Contributor

react-draggable-tab hides a tab by setting its height: 0.
This means, that the contents of each tab need to be resized every time the tab is selected.
This may cause the view engine to render the selected tab very slowly.

Solution 1:

Switch to absolute hiding

// Hide
left: -9999999px;

// Show
left: 0;

Solution 2:

Let the user configure the hiding styles via props

@aleksandrenko
Copy link

Why can't you just use display: none;?

georgeOsdDev pushed a commit that referenced this issue Jul 13, 2016
@georgeOsdDev
Copy link
Owner

I added hiddenConteinerStyle 5084ea5
User now can use any hidden style.

When you use left: -9999999px it cause unexpected scrollbar and space when after tab is selected.
Any good idea??

@georgeOsdDev
Copy link
Owner

georgeOsdDev commented Jul 13, 2016

PS: display: none; cause browser re-flow.

http://stackoverflow.com/questions/11757016/performance-differences-between-visibilityhidden-and-displaynone

So I think it costs as same as height: 0

@HaNdTriX
Copy link
Contributor Author

@georgeOsdDev Awesome! Thanks a lot!

georgeOsdDev added a commit that referenced this issue Jul 14, 2016
@georgeOsdDev
Copy link
Owner

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

No branches or pull requests

3 participants