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

perf(picker): avoid flicker on ios #29101

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Feb 29, 2024

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?

  • The root of the intersection observer is now the parent picker element which avoids the WebKit quirk.
feature-8.0 branch
before.mov
after.mov

Does this introduce a breaking change?

  • Yes
  • No

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.

@github-actions github-actions bot added the package: core @ionic/core package label Feb 29, 2024
@liamdebeasi liamdebeasi marked this pull request as ready for review February 29, 2024 17:36
@liamdebeasi liamdebeasi requested review from a team and thetaPC and removed request for a team February 29, 2024 17:36
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it works great! The flicker is no longer there.

@liamdebeasi liamdebeasi merged commit 94c3ffc into feature-8.0 Mar 6, 2024
44 checks passed
@liamdebeasi liamdebeasi deleted the picker-perf-overlay branch March 6, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants