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

How to update options? #32

Closed
Benvorth opened this issue Oct 6, 2016 · 2 comments
Closed

How to update options? #32

Benvorth opened this issue Oct 6, 2016 · 2 comments
Labels

Comments

@Benvorth
Copy link

Benvorth commented Oct 6, 2016

... after the react-iscroll was rendered on DOM? For example I want to disable scrollY under certain conditions and re-enable it later. Binding the options=... to a state variable didn't work...

@schovi
Copy link
Owner

schovi commented Nov 1, 2016

@Benvorth react-iscroll should reinitialize iscroll itself when options changed. It was build with this feature in mind. Have to test it somehow.

@schovi
Copy link
Owner

schovi commented Nov 1, 2016

@Benvorth Improved example file to show how to do it. d960194?diff=unified#diff-9dc42c58804e2841c5330a81a75b977bR77

Key is Object.assign({}, currentOptions, changedOptions). That mean, you have to create new object. Inside react-iscroll I do not compare each property separately, so If you just modify existing object it wont update component and wont refresh iscroll with new options.

I will take I look if I comparing can support changing of properties in options.

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

No branches or pull requests

2 participants