Repository navigation
v1.0.0
Changes
-
Changed
nativeOverlaytowindowOverlayonModalBottomSheet. The behavior is the same. -
Changed
settleDurationfrom seconds to milliseconds. The default is450. In development, a value below10logs a warning, since it is likely a leftover value in seconds. -
Changed close requests on
ModalBottomSheetso one rule covers every way of asking a sheet to close without dragging it: a scrim tap, a screen reader’s dismiss action, Android system back, and Escape on Android and the web.-
With
onCloseRequest, each of these only calls the handler. The sheet does not move, so the handler can confirm first, close a sheet that has no closed detent, or ignore the request. -
Without
onCloseRequest, each of these snaps the sheet to its closed detent and reports it throughonIndexChange. This requires a visible scrim and a closed detent that is notprogrammatic. -
Dragging the sheet closed is unchanged and always reports through
onIndexChange.
-
-
Added
onCloseRequestsupport on iOS. It is called for scrim taps, the scrim’s Dismiss button, and the VoiceOver escape gesture. -
Changed the default for Android system back and for Escape on Android and the web. A modal sheet without
onCloseRequestnow closes instead of letting the input pass to the app, and keeps consuming it until the closing animation finishes. -
Changed Escape routing on the web to match Android. The top modal sheet blocks the sheets it covers even when it does not act on Escape.
-
Added
startandendto a detent’sinsets. They follow the layout direction and take precedence overleftorright, whichever they resolve to. On the web, the layout direction is the document’s. -
Fixed start and end corner radii in
surfaceStyleon the web in right-to-left documents. -
Changed
scrimColorto accept anyColorValue, includingPlatformColorandDynamicColorIOS. -
Changed the type of
wrapNativeViewso it no longer exposes the internal native props. PassingAnimated.createAnimatedComponentworks as before. -
Added the
BottomSheetProviderPropstype export. -
Added
react-domandreact-native-webas optional peer dependencies.
Migrating from 0.18.1
-
Rename
nativeOverlaytowindowOverlay: Keep the value you passed. -
Convert
settleDurationto milliseconds: Multiply your value by1000.// 0.18.1 settleDuration={0.55} // 1.0.0 settleDuration={550}
-
Review sheets that use
onCloseRequest: The handler now also receives scrim taps and screen reader dismiss actions, on every platform including iOS, and the sheet no longer closes by itself for those. If your handler does not already close the sheet, setindexto the closed detent in it.onCloseRequest={() => setIndex(0)}
-
Review modal sheets without
onCloseRequest: Android system Back and Escape now close the sheet. To keep the sheet open, add anonCloseRequesthandler that does nothing, or make the closed detentprogrammatic. -
Update typed
wrapNativeViewwrappers: If you annotated the wrapper’s parameter with the native props type, useComponentType<any>.