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 Crash Fix #2110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cbowdoin
Copy link
Contributor

@cbowdoin cbowdoin commented Nov 22, 2024

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

When the bottom sheet is animating the views width can become 0 and thus results in our available width being able to be less than the minimum width resulting in a crash if the animation is interupted at the right time.

To fix this we add a guard to make sure that out available width is less than the minWidth before doing a range operation.

Binary change

Not currently measurable with new infra.

Verification

Tested in bottom sheet demo with a button to allow closing/opening of the sheet while animating.

Visual Verification
Before After
Sheet could cause crash when animating Sheet will preform a check to make sure we are creating a valid range

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 marked this pull request as ready for review December 12, 2024 21:21
@cbowdoin cbowdoin requested a review from a team as a code owner December 12, 2024 21:21
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.

1 participant