noeldelgado / gemini-scrollbar

:first_quarter_moon: Custom overlay-scrollbars with native scrolling mechanism for web applications
https://noeldelgado.github.io/gemini-scrollbar/
MIT License
429 stars 63 forks source link

Add an option to turn off relayouts on update #31

Closed richvdh closed 8 years ago

richvdh commented 8 years ago

@noeldelgado, I would be interested to know what you think of this.

We did some profiling and found that updating the contents of the scrolling div was quite expensive, because resetting the viewElement width made the browser reflow the entire DOM, which was often unnecessary.

Do you know the purpose of resetting this._viewElement.style.width? As you can see, I made it optional (and exposed this via the react wrapper); we've had it disabled in our application for some time now with no apparent ill-effects.

noeldelgado commented 8 years ago

Hi @richvdh, since the resizer-trigger was added those lines are no longer needed, you can safely remove them.

Thanks 👍

richvdh commented 8 years ago

Ok; I've removed the offending coed altogether.