-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
Throttle recalculations (v2) #40
Comments
Definitely something needed. Can I ask what is your use case so I can understand better the kind of scenario where this could be needed? |
Our use case is quite simple: We have a long scrollable list of items where items are added one by one through appendChild. Most are added at load time, but more are removed and added dynamically afterwards too. Temporarily disabling the mutation observer while loading the initial batch of items would probably work great too. |
Ok thanks very much for that. I'll try to setup a similar scenario so I can test it, seems like a quite common use case (infinite scroll...etc). |
Thanks for the quick update! It works great now :) |
* v2: (50 commits) 2.0.0 fix a bug where querySelectorAll is not always an Array (on IE11 for ex) after adding of new `enabled` prop Simplebar wasn't working anymore add a forceEnabled option to force simplebar to be active even if it's not needed refactor static properties as static getters Add an `enabled` prop to know if Simplebar is active or uses floating scrollbar (fix #42) Update README.md Update README.md 2.0.0-beta.3 add function to remove mutation observer define html api init as static of SimpleBar class debounce recalculate function to improve performances (fix #40) improve demo with more usecases remove useless css selector + scroll to auto remove useless line fix scrollbar appearant when content is not wide enough to overflow (fix simplar on some layouts) fix mouting/unmounting of Simplebar when removed and added back to the DOM Update README.md 2.0.0-beta.2 MutationObserver now works if the simplebar div itself is deleted too (regression) ... # Conflicts: # README.md
What are your thoughts on throttling recalculations triggered by the mutation observer? I have a element which triggers the recaluclation ~ 1000 times before it's done and it's of course killing the performance.
The text was updated successfully, but these errors were encountered: