Fix a switching glitch in fade mode when last fading animation is still ongoing #1307
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.
Bug description:
In 'fade' mode using pagers, when previous transition fade animation is still ongoing (say, from slide index A to slide index B), clicking on another pager (say, slide index C) results in as if the third pager cannot be clicked. The current active slide and pager remains showing the previous one (index B). But actual activate index seems to be the newest one (index C), which can be told by trying to move to next/prev slide or switch to other slides using pager. The symptoms are similar with autoplay on.
Confirmed case:
In Chrome 136.0.7103.114 on MacOS amd64, sets bxslider on 3 slides with 'fade' mode and a relatively slow speed like 1200.
a) Set autoplay to false, click the 2nd pager, and quickly click the 3rd pager.
b) Set autoplay to true, when transition animation is working, quickly click another pager than the next slide.
Possible reason:
In goToSlide() function, when called before last fade transition is finished, the variable slider.working is still true, preventing ui following transition codes to execute, yet it sets active index to the new value. The last fadeIn() animation, however, still executes, and when finished, shows the last active slide instead of the newest set one. This causes an mismatch between ui state and internal data.
Fix:
Possible fix of goToSlide() may include:
Current PR tries to implement the latter method.