-
-
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
Nested SimpleBars Cause Multiple Initializations #295
Comments
A temporary solution for anyone affected is to add the following line to the top of their script. SimpleBar.removeObserver() This will completely disable the MutationObserver and only allow manual initialization, thereby avoiding the problem. |
Grsmto
added a commit
that referenced
this issue
Apr 11, 2019
Should be fixed in |
FYI I reverted the fix for this as it wasn't actually working properly.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Behavior
When nested
SimpleBars
are initialized from JavaScript, the MutationObserver will trigger a re-initialization of the children.Expected behavior
The MutationObserver shouldn't re-initialize a simplebar with default options when it has already been created.
Reproducible example
Demo. The settings for
autoHide
are set tofalse
for all.scroll-area
s, but the child scroll area is initialized a second time due to the MutationObserver detecting the change of the first one. This causes the settings to get overwritten for the child and theautoHide
is re-enabled.Suggested solution(s)
MutationObserver should not re-initialize elements with a
data-simplebar
attribute set toinit
.Your environment
The text was updated successfully, but these errors were encountered: