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

Reinitialize scrollbar on dynamically-added content #68

Open
inigopascall opened this issue Sep 28, 2017 · 7 comments
Open

Reinitialize scrollbar on dynamically-added content #68

inigopascall opened this issue Sep 28, 2017 · 7 comments

Comments

@inigopascall
Copy link

Hi, thanks for a great little plugin.

In my case I am using on a div which has content added dynamically (and thus the height varies) and so I need to able to reinitialize the scrollbar to fit the new content.

Is it possible to do this? Thanks.

@jkuri
Copy link
Owner

jkuri commented Sep 28, 2017

check the input events.

@inigopascall
Copy link
Author

Hi @jkuri thanks for your reply. Apologies if I'm being dense here- I'm still quite new to Angular 2 so possibly I'm missing some fundamentals here... can you elaborate please- are you referring to hooks in the plugin itself (there's nothing about this on the instructions as far as I can see)?

@jkuri
Copy link
Owner

jkuri commented Sep 28, 2017

@InigoWD no problem at all. When you add some content to the div you need to send input event to slimscroll directive so it is aware that content or height has changed and reinitializes bar.
If you check the example in readme you can see there are multiple events that can be send to slimscroll directive. I believe that one you are looking for is recalculate.

Hope this helps you proceed.

@inigopascall
Copy link
Author

Ah, I see now. Thanks for your help and quick response, much appreciated! :)

@jkuri
Copy link
Owner

jkuri commented Sep 28, 2017

👍 you welcome

@abdelrhman92
Copy link

I am facing the similar problem here. Adding content is ok for me so but when I delete content the scroll bar still same length. Till I reach a minimum length It disappear.

@raalarcon9705
Copy link

Hi, I discovered this plugin recently ... it's fantastic.
But when I use it with an ngFor directive to define the content, I can't restart the scroll

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

4 participants