scroll to new position if swipe container size chages (ex: orientatio… #1137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The scrollTo method should not be called only on initial render. onLayout invoke can be caused by an orientation change or swipe container resize. So whenever we have got slides inside we should consider to call scrollTo
Is it a bugfix ?
Yes (No ticket # yet)
Bug can be tested on Android tablet (Galaxy tab A). Just make a fullscreen swiper fill with some colored boxes and move to a slideindex more then 0. Then change the orientation. The slider will stack in between 2 slides and not adjust it's scroll position.
Is it a new feature ?
No
Describe what you've done:
Just moved the scrollTo method outside the initialRender method. I think there is no need for the initialRender flag anymore
How to test it ?
See Bugfix