Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion resources/ios/NativeUIBottomSheetRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ struct NativeUIBottomSheetRenderer: View {
detents: resolveDetents(detentsStr),
selection: fits ? $selectedDetent : nil
))
.presentationDragIndicator(.visible)
// The system shows the grabber only when the sheet can be
// resized, as Apple's HIG has it. A single-detent sheet has
// nothing to drag between, so a grabber would only mislead.
.presentationDragIndicator(.automatic)
.interactiveDismissDisabled(permanent)
.presentationBackgroundInteraction(bgInteraction ? .enabled : .automatic)
.modifier(A11yLabelModifier(label: a11yLabel))
Expand Down
9 changes: 9 additions & 0 deletions tests/BottomSheetRendererTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

test('leaves the iOS grabber to the system, so only a resizable sheet shows one', function () {
$renderer = file_get_contents(dirname(__DIR__).'/resources/ios/NativeUIBottomSheetRenderer.swift');

expect($renderer)
->toBeString()
->toMatch('/\.presentationDragIndicator\(\.automatic\)/')
->not->toContain('.presentationDragIndicator(.visible)');
});

test('keeps the Android bottom sheet composed until hiding it has slid it away', function () {
$rendererPath = dirname(__DIR__).'/resources/android/BottomSheetRenderer.kt';

Expand Down
Loading