Page MenuHomePhabricator

[native] introduce custom bottom sheet handle component
ClosedPublic

Authored by ginsu on Aug 25 2023, 1:23 PM.
Tags
None
Referenced Files
F3382343: D8958.diff
Thu, Nov 28, 10:03 AM
Unknown Object (File)
Tue, Nov 26, 4:51 AM
Unknown Object (File)
Tue, Nov 26, 4:00 AM
Unknown Object (File)
Mon, Nov 25, 9:45 PM
Unknown Object (File)
Mon, Nov 25, 7:16 PM
Unknown Object (File)
Fri, Nov 22, 3:20 PM
Unknown Object (File)
Mon, Nov 11, 11:48 AM
Unknown Object (File)
Sat, Nov 9, 8:49 AM
Subscribers

Details

Summary

Based on our designs we need to implement a custom bottom sheet handle component that can be passed to BottomSheetModal as a prop.

Designs:

Screenshot 2023-08-25 at 2.19.48 PM.png (1×734 px, 134 KB)

Link to the docs: https://gorhom.github.io/react-native-bottom-sheet/props#handlecomponent

Depends on D8955

Test Plan

Please see the before and after screenshots:

Before:

Screenshot 2023-08-25 at 4.21.04 PM.png (1×1 px, 774 KB)

After:

Screenshot 2023-08-25 at 4.26.29 PM.png (1×1 px, 774 KB)

Diff Detail

Repository
rCOMM Comm
Branch
eng-3998 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu edited the test plan for this revision. (Show Details)

update height

ginsu requested review of this revision.Aug 25 2023, 1:49 PM
native/bottom-sheets/bottom-sheet-handle.react.js
16 ↗(On Diff #30335)

We need this second view here in order to prevent the following from happening:

If a user presses down in between the knob and bottomsheet it triggers unwanted actions in the background. Eventually when we place a backdrop with the bottomsheet, this will also help prevent these unwanted background actions; however, it could also lead to unwanted dismissals of the bottomsheet.

Adding this view as a gap (green background) does the following:

It makes sure that even if the user presses down in the gap between the bottom sheet and the knob, the gap is part of the handle so it will only control the bottomsheet

This revision is now accepted and ready to land.Aug 27 2023, 11:51 AM
This revision was landed with ongoing or failed builds.Sep 6 2023, 11:07 AM
This revision was automatically updated to reflect the committed changes.
native/bottom-sheets/bottom-sheet-handle.react.js
37 ↗(On Diff #30802)

Would've been great to React.memo this component. It only ever needs to be rendered once (unless color scheme changes)