Skip to content

Commit 5d4fe3b

Browse files
authored
[MOO-2266] : fix bottom sheet to avoid app crash (#482)
2 parents 938b7c5 + fa635ae commit 5d4fe3b

9 files changed

Lines changed: 441 additions & 231 deletions

File tree

2.4 KB
Loading

packages/pluggableWidgets/bottom-sheet-native/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- Fixed the “non‑worklet function called on the UI thread” error in bottom sheet coming from @gorhom/bottom-sheet usage.
12+
- Fixed ExpandingDrawer to open correctly and show all elements.
13+
14+
### Changed
15+
16+
- Improved performance by memoizing all callbacks with useCallback and useMemo across all components.
17+
- BottomSheet now uses BottomSheetScrollView instead of BottomSheetView, enabling proper scrolling in expanded states.
18+
- NativeBottomSheet now explicitly calculates snapPoints with 90% screen height cap for predictable sizing.
19+
- CustomModalSheet now measures content height dynamically with 90% screen height cap, removing offscreen SafeAreaView measurement.
20+
921
## [5.0.3] - 2025-12-15
1022

1123
- Updated react-native-reanimated to v3.17.5. This addresses compatibility issues with React Native 0.78 and later versions.

packages/pluggableWidgets/bottom-sheet-native/e2e/specs/maestro/Modal_basic_non_native.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ appId: "${APP_ID}"
1010
text: "Modal basic non native"
1111
- tapOn:
1212
text: "Open"
13-
# Because the image loading can take some time due to resources on emulator, we need to wait for the image to be visible
14-
- extendedWaitUntil:
15-
visible: randText # Any random text that does not exist in the UI
16-
optional: true # This should be true so that the test won't fail
17-
timeout: 10000 # 10 seconds
13+
14+
# Wait until the sheet is actually open (button label changes)
15+
- extendedWaitUntil:
16+
visible: randText
17+
optional: true
18+
timeout: 25000
19+
1820
- takeScreenshot:
1921
path: "maestro/images/actual/${PLATFORM}/bottom_sheet_modal_basic_non_native"

packages/pluggableWidgets/bottom-sheet-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bottom-sheet-native",
33
"widgetName": "BottomSheet",
4-
"version": "5.0.3",
4+
"version": "5.0.4",
55
"license": "Apache-2.0",
66
"repository": {
77
"type": "git",

packages/pluggableWidgets/bottom-sheet-native/src/__tests__/__snapshots__/BottomSheet.spec.tsx.snap

Lines changed: 90 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,104 +2,159 @@
22

33
exports[`Bottom sheet renders a custom bottom action sheet for ios (Basic modal) with custom style 1`] = `null`;
44

5-
exports[`Bottom sheet renders a custom modal 1`] = `
5+
exports[`Bottom sheet renders a custom modal 1`] = `null`;
6+
7+
exports[`Bottom sheet renders a expanding 1`] = `
68
<View
9+
pointerEvents="box-none"
710
style={
811
{
912
"bottom": 0,
1013
"left": 0,
11-
"opacity": 0,
1214
"position": "absolute",
1315
"right": 0,
1416
"top": 0,
1517
}
1618
}
1719
>
18-
<RCTSafeAreaView
19-
onLayout={[Function]}
20+
<View
2021
style={
2122
{
22-
"flex": 1,
23+
"bottom": 0,
24+
"left": 0,
25+
"opacity": 0,
26+
"pointerEvents": "none",
27+
"position": "absolute",
28+
"right": 0,
29+
"zIndex": -1,
2330
}
2431
}
25-
/>
26-
</View>
27-
`;
28-
29-
exports[`Bottom sheet renders a expanding 1`] = `
30-
<View
31-
style={
32-
{
33-
"bottom": -1334,
34-
"position": "absolute",
35-
}
36-
}
37-
>
38-
<View
39-
onLayout={[Function]}
40-
pointerEvents="box-none"
4132
>
4233
<View
4334
onLayout={[Function]}
4435
pointerEvents="box-none"
45-
style={{}}
4636
>
4737
<Text>
4838
Header
4939
</Text>
5040
</View>
51-
<Text>
52-
Content
53-
</Text>
41+
<View
42+
onLayout={[Function]}
43+
pointerEvents="box-none"
44+
>
45+
<Text>
46+
Content
47+
</Text>
48+
</View>
5449
</View>
5550
</View>
5651
`;
5752

5853
exports[`Bottom sheet renders a expanding fullscreen 1`] = `
5954
<View
55+
pointerEvents="box-none"
6056
style={
6157
{
6258
"bottom": 0,
6359
"left": 0,
64-
"opacity": 0,
6560
"position": "absolute",
6661
"right": 0,
6762
"top": 0,
6863
}
6964
}
7065
>
71-
<RCTSafeAreaView
72-
onLayout={[Function]}
66+
<View
7367
style={
7468
{
75-
"flex": 1,
69+
"bottom": 0,
70+
"left": 0,
71+
"opacity": 0,
72+
"pointerEvents": "none",
73+
"position": "absolute",
74+
"right": 0,
75+
"zIndex": -1,
7676
}
7777
}
78-
/>
78+
>
79+
<View
80+
onLayout={[Function]}
81+
pointerEvents="box-none"
82+
>
83+
<Text>
84+
Header
85+
</Text>
86+
</View>
87+
<View
88+
onLayout={[Function]}
89+
pointerEvents="box-none"
90+
>
91+
<Text>
92+
Content
93+
</Text>
94+
</View>
95+
<View
96+
onLayout={[Function]}
97+
pointerEvents="box-none"
98+
>
99+
<Text>
100+
Full screen content
101+
</Text>
102+
</View>
103+
</View>
79104
</View>
80105
`;
81106

82107
exports[`Bottom sheet renders a expanding fullscreen with custom styles 1`] = `
83108
<View
109+
pointerEvents="box-none"
84110
style={
85111
{
86112
"bottom": 0,
87113
"left": 0,
88-
"opacity": 0,
89114
"position": "absolute",
90115
"right": 0,
91116
"top": 0,
92117
}
93118
}
94119
>
95-
<RCTSafeAreaView
96-
onLayout={[Function]}
120+
<View
97121
style={
98122
{
99-
"flex": 1,
123+
"bottom": 0,
124+
"left": 0,
125+
"opacity": 0,
126+
"pointerEvents": "none",
127+
"position": "absolute",
128+
"right": 0,
129+
"zIndex": -1,
100130
}
101131
}
102-
/>
132+
>
133+
<View
134+
onLayout={[Function]}
135+
pointerEvents="box-none"
136+
>
137+
<Text>
138+
Header
139+
</Text>
140+
</View>
141+
<View
142+
onLayout={[Function]}
143+
pointerEvents="box-none"
144+
>
145+
<Text>
146+
Content
147+
</Text>
148+
</View>
149+
<View
150+
onLayout={[Function]}
151+
pointerEvents="box-none"
152+
>
153+
<Text>
154+
Full screen content
155+
</Text>
156+
</View>
157+
</View>
103158
</View>
104159
`;
105160

0 commit comments

Comments
 (0)