perf(picker): avoid flicker on ios #29101
Merged
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.
Issue number: N/A (see below)
What is the current behavior?
Mike found an issue while testing the Ionic 8 beta where there's a flicker when presenting a picker in a modal on iOS. We've seen this issue before, and the reason why it's happening is there's a quirk in WebKit where the IntersectionObserver callback is fired after an accelerated animation completes given a particular IO configuration.
The end result is there's a delay before each picker column is scrolled to the correct place.
In particular, the modal enter animation on iOS is an accelerated animation, and we use an IO to control when the picker columns should scroll their active options into view.
What is the new behavior?
feature-8.0
before.mov
after.mov
Does this introduce a breaking change?
Other information
Dev build:
8.0.0-dev.11709226349.179192de
Note: Given that this bug is due to a WebKit quirk and is timing-related, I did not add a test.