Skip to content

Bottom Sheet Animation Completes Regardless of Safe Area Changes#2118

Merged
cbowdoin merged 3 commits intomicrosoft:mainfrom
cbowdoin:bottomSheetContinuesAnimateDuringSafeAreaChange
Jan 28, 2025
Merged

Bottom Sheet Animation Completes Regardless of Safe Area Changes#2118
cbowdoin merged 3 commits intomicrosoft:mainfrom
cbowdoin:bottomSheetContinuesAnimateDuringSafeAreaChange

Conversation

@cbowdoin
Copy link
Copy Markdown
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
Copy Markdown
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
@joannaquu joannaquu mentioned this pull request Apr 4, 2025
12 tasks
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