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

Bottom Sheet Animation Completes Regardless of Safe Area Changes #2118

Conversation

cbowdoin
Copy link
Contributor

@cbowdoin cbowdoin commented Jan 17, 2025

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

When a safe area change happens, we get callback to viewSafeAreaInsetsDidChange which will call completeAnimationsIfNeeded(skipToEnd: true). When we get this call we currently pass in skipToEnd as true, this results in us not properly animating the sheet in scenarios where the sheets safe area changes during the animation such as when the keyboard is being presented. By passing in false to skipToEnd we can avoid skipping an animation that the user is currently watching.

Binary change

TBD

Verification

  • Safe area changes while the sheet is animating are not interrupted
  • Changing the safe area while sheet is not animating puts the sheet in the correct location
  • Safe Area changes while sheet is not animating do not animate the sheet
Visual Verification
Before After
Safe area change that occurred during a sheet animation skips it to the completed state Animations continue on their current path while animating during a safe area change

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@cbowdoin cbowdoin changed the title Safe area change forcing animations to skip to the end state is removed [Draft ] Bottom Sheet Animation Completes Regardless of Safe Area Changes Jan 17, 2025
@cbowdoin cbowdoin marked this pull request as ready for review January 17, 2025 20:23
@cbowdoin cbowdoin requested a review from a team as a code owner January 17, 2025 20:23
@cbowdoin cbowdoin changed the title [Draft ] Bottom Sheet Animation Completes Regardless of Safe Area Changes Bottom Sheet Animation Completes Regardless of Safe Area Changes Jan 17, 2025
@anandrajeswaran
Copy link
Contributor

For future reference, can you be more specific in the "Verification" section? Which customer scenarios in the demo app did you verify that exercised those code paths where safe areas change?

@cbowdoin cbowdoin merged commit 7ad34ed into microsoft:main Jan 28, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants