Sheet presentationDetents breaks after rapid open/dismiss cycles

Basic Information

Please provide a descriptive title for your feedback:

Sheet presentationDetents breaks after rapid open/dismiss cycles

Which platform is most relevant for your report?

iOS

Description

Steps to Reproduce:

  1. Create a sheet with presentationDetents([.medium])
  2. Rapidly perform these actions multiple times (usually 3-4 times): a. Open the sheet b. Immediately scroll down to dismiss
  3. Open the sheet again
  4. Observe that the sheet now appears at .large size, ignoring the .medium detent

Expected Result: Sheet should consistently maintain .medium size regardless of how quickly it is opened and dismissed.

Actual Result: After rapid open/dismiss cycles, the sheet ignores .medium detent and appears at .large size.

Reproduction Rate:

  • Occurs consistently after 3-4 rapid open/dismiss cycles
  • More likely to occur with faster open/dismiss actions

Configuration:

  • iOS 18
  • Xcode 16.0 (16A242d)
  • SwiftUI
  • Device: iPhone 14

I've filed a Feedback Assistant report for this issue: FB15718814

I experience the same bug. It seems that it was introduced in IOS 18.0 as I couldnt reproduce with IOS 17.5 (and also experienced it with IOS 18.1)

Thanks for filing the bug report, I was able to reproduce the issue and it looks like a bug to me.

Have you tried specifying a custom detent with a height as a way to workaround the issue ?

Sheet presentationDetents breaks after rapid open/dismiss cycles
 
 
Q