Skip to content

Bottom Sheet Animation Crash Fix#2110

Merged
cbowdoin merged 1 commit intomicrosoft:mainfrom
cbowdoin:user/cbowdoin/BottomSheetMaxWidthGuard
Dec 17, 2024
Merged

Bottom Sheet Animation Crash Fix#2110
cbowdoin merged 1 commit intomicrosoft:mainfrom
cbowdoin:user/cbowdoin/BottomSheetMaxWidthGuard

Conversation

@cbowdoin
Copy link
Copy Markdown
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
@cbowdoin cbowdoin merged commit 5f65631 into microsoft:main Dec 17, 2024
@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.

2 participants