Skip to content

[Bottom Sheet] Merge duplicate detents + other fixes#2254

Closed
lukas-cap wants to merge 2 commits intomainfrom
user/lucapkov/bottom-sheet-merge-detents
Closed

[Bottom Sheet] Merge duplicate detents + other fixes#2254
lukas-cap wants to merge 2 commits intomainfrom
user/lucapkov/bottom-sheet-merge-detents

Conversation

@lukas-cap
Copy link
Copy Markdown
Contributor

@lukas-cap lukas-cap commented Mar 19, 2026

  1. We saw a bug where the partial detent height wasn't accounting for bottom safe area.

  2. While fixing that, I noticed we have a lot of bugs around detent availability in restricted height scenarios. Dynamic height resolvers can produce a partial height effectively equal to collapsed or expanded. This caused invisible state cycling on handle taps, incorrect pan snapping, and meaningless delegate notifications.

Add supportsCollapsedState and supportsPartialState computed properties that gate detent availability. Partial is skipped when its height is within a merge threshold of collapsed or expanded. Collapsed is skipped when the sheet is height-restricted. Layout changes that invalidate the current detent reposition the sheet to expanded with delegate notification.

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

(a summary of the changes made, often organized by file)

Binary change

(how is our binary size impacted -- see https://github.com/microsoft/fluentui-apple/wiki/Size-Comparison)

Verification

(how the change was tested, including both manual and automated tests)

Visual Verification
Before After
Screenshot or description before this change Screenshot or description with this 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

…panded

Dynamic height resolvers can produce a partial height effectively equal
to collapsed or expanded. This caused invisible state cycling on handle
taps, incorrect pan snapping, and meaningless delegate notifications.

Add supportsCollapsedState and supportsPartialState computed properties
that gate detent availability. Partial is skipped when its height is
within a merge threshold of collapsed or expanded. Collapsed is skipped
when the sheet is height-restricted. Layout changes that invalidate the
current detent reposition the sheet to expanded with delegate notification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lukas-cap lukas-cap requested a review from a team as a code owner March 19, 2026 05:16
@lukas-cap lukas-cap closed this Mar 19, 2026
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