diff --git a/resources/ios/NativeUIBottomSheetRenderer.swift b/resources/ios/NativeUIBottomSheetRenderer.swift index 0b135cb..c828c33 100644 --- a/resources/ios/NativeUIBottomSheetRenderer.swift +++ b/resources/ios/NativeUIBottomSheetRenderer.swift @@ -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)) diff --git a/tests/BottomSheetRendererTest.php b/tests/BottomSheetRendererTest.php index 0b6c7e4..c259431 100644 --- a/tests/BottomSheetRendererTest.php +++ b/tests/BottomSheetRendererTest.php @@ -1,5 +1,14 @@ 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';