Skip to content

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 14:29
7b48a4b

Changes

  • Changed nativeOverlay to windowOverlay on ModalBottomSheet. The behavior is the same.

  • Changed settleDuration from seconds to milliseconds. The default is 450. In development, a value below 10 logs a warning, since it is likely a leftover value in seconds.

  • Changed close requests on ModalBottomSheet so 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 through onIndexChange. This requires a visible scrim and a closed detent that is not programmatic.

    • Dragging the sheet closed is unchanged and always reports through onIndexChange.

  • Added onCloseRequest support 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 onCloseRequest now 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 start and end to a detent’s insets. They follow the layout direction and take precedence over left or right, whichever they resolve to. On the web, the layout direction is the document’s.

  • Fixed start and end corner radii in surfaceStyle on the web in right-to-left documents.

  • Changed scrimColor to accept any ColorValue, including PlatformColor and DynamicColorIOS.

  • Changed the type of wrapNativeView so it no longer exposes the internal native props. Passing Animated.createAnimatedComponent works as before.

  • Added the BottomSheetProviderProps type export.

  • Added react-dom and react-native-web as optional peer dependencies.

Migrating from 0.18.1

  1. Rename nativeOverlay to windowOverlay: Keep the value you passed.

  2. Convert settleDuration to milliseconds: Multiply your value by 1000.

    // 0.18.1
    settleDuration={0.55}
    
    // 1.0.0
    settleDuration={550}
  3. 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, set index to the closed detent in it.

    onCloseRequest={() => setIndex(0)}
  4. Review modal sheets without onCloseRequest: Android system Back and Escape now close the sheet. To keep the sheet open, add an onCloseRequest handler that does nothing, or make the closed detent programmatic.

  5. Update typed wrapNativeView wrappers: If you annotated the wrapper’s parameter with the native props type, use ComponentType<any>.