Skip to content

Commit f6336bc

Browse files
authored
[expo-router] Fix modal with detents fixToContents on Android (expo#38440)
# Why When modal was used with presentationStyle `formsheet` and detents `fitToContents`, the on Android it took all available space, instead of just contents. ## Before https://github.com/user-attachments/assets/cdb5ce21-4470-4603-960b-6f5c54e72420 ## After https://github.com/user-attachments/assets/67225dac-14fd-4a33-b5db-92084f94c8fb # How 1. When presentationStyle is `formsheet` and detents are `fitToContents`, the flex property is set to `undefined` # Test Plan 1. Manual testing on Android and iOS # Checklist <!-- Please check the appropriate items below if they apply to your diff. --> - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
1 parent 0234a4f commit f6336bc

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

packages/expo-router/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- Add static rewrites support to export and server-side handling ([#37930](https://github.com/expo/expo/pull/37930) by [@hassankhan](https://github.com/hassankhan))
3535
- Fix old arch build with LinkPreview code ([#38305](https://github.com/expo/expo/pull/38305) by [@Ubax](https://github.com/Ubax))
3636
- [iOS] Add compiler flags for new arch to expo router ([#38397](https://github.com/expo/expo/pull/38397) by [@Ubax](https://github.com/Ubax))
37+
- Fix modal with detents fixToContents on Android ([#38440](https://github.com/expo/expo/pull/38440) by [@Ubax](https://github.com/Ubax))
3738

3839
### 💡 Others
3940

packages/expo-router/build/modal/ModalsRenderer.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/expo-router/build/modal/ModalsRenderer.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/expo-router/src/modal/ModalsRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const ModalsRenderer = ({
4242
}}
4343
contentStyle={[
4444
{
45-
flex: 1,
45+
flex: config.presentationStyle !== 'formSheet' ? 1 : undefined,
4646
backgroundColor: config.transparent ? 'transparent' : 'white',
4747
},
4848
config.viewProps?.style,

0 commit comments

Comments
 (0)