@@ -182,6 +182,9 @@ export function Outer({
182
182
)
183
183
}
184
184
185
+ /**
186
+ * @deprecated use `Dialog.ScrollableInner` instead
187
+ */
185
188
export function Inner ( { children, style, header} : DialogInnerProps ) {
186
189
const insets = useSafeAreaInsets ( )
187
190
return (
@@ -207,6 +210,7 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>(
207
210
) {
208
211
const { nativeSnapPoint, disableDrag, setDisableDrag} = useDialogContext ( )
209
212
const insets = useSafeAreaInsets ( )
213
+ const [ contentSize , setContentSize ] = React . useState ( 0 )
210
214
211
215
useEnableKeyboardController ( isIOS )
212
216
@@ -225,14 +229,10 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>(
225
229
let paddingBottom = 0
226
230
if ( isIOS ) {
227
231
paddingBottom += keyboardHeight / 4
228
- if ( isIOS26 ) {
229
- paddingBottom += tokens . space . xl
230
- } else {
231
- if ( nativeSnapPoint === BottomSheetSnapPoint . Full ) {
232
- paddingBottom += insets . bottom + tokens . space . md
233
- }
234
- paddingBottom = Math . max ( paddingBottom , tokens . space . _2xl )
232
+ if ( nativeSnapPoint === BottomSheetSnapPoint . Full ) {
233
+ paddingBottom += insets . bottom + tokens . space . md
235
234
}
235
+ paddingBottom = Math . max ( paddingBottom , tokens . space . _2xl )
236
236
} else {
237
237
paddingBottom += keyboardHeight
238
238
if ( nativeSnapPoint === BottomSheetSnapPoint . Full ) {
@@ -254,11 +254,37 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>(
254
254
}
255
255
}
256
256
257
+ // iOS26 floaty sheets have this annoying extra safe area when sheets are 150px or more
258
+ // TODO: Remove this behaviour on the native side!! I could not figure it out -sfn
259
+ //
260
+ // fix by using a negative margin on the scrollview when the sheet is in this zone (it's fine for large sheets)
261
+ const IOS_MIN_HEIGHT_FOR_SAFEAREA = 151
262
+ const IOS_MAX_HEIGHT_FOR_SAFEAREA = 400
263
+ const iosAutoSafeAreaHeightAdjust = 34
264
+ const shouldAttemptUndoSafeArea =
265
+ isIOS26 &&
266
+ contentSize > IOS_MIN_HEIGHT_FOR_SAFEAREA &&
267
+ contentSize < IOS_MAX_HEIGHT_FOR_SAFEAREA
268
+ const adjustedSize =
269
+ contentSize -
270
+ ( shouldAttemptUndoSafeArea ? iosAutoSafeAreaHeightAdjust : 0 )
271
+ // reducing the padding obviously then makes it dip back under 150px, so we need to adjust
272
+ // again to ensure a minimum height of 150
273
+ const ensureMinHeight = Math . min (
274
+ 0 ,
275
+ adjustedSize - IOS_MIN_HEIGHT_FOR_SAFEAREA ,
276
+ )
277
+ const marginBottom = shouldAttemptUndoSafeArea
278
+ ? iosAutoSafeAreaHeightAdjust * - 1 - ensureMinHeight
279
+ : 0
280
+
257
281
return (
258
282
< KeyboardAwareScrollView
283
+ style = { [ { marginBottom} ] }
284
+ onContentSizeChange = { ( _width , height ) => setContentSize ( height ) }
259
285
contentContainerStyle = { [
260
286
a . pt_2xl ,
261
- a . px_xl ,
287
+ a . px_2xl ,
262
288
{ paddingBottom} ,
263
289
contentContainerStyle ,
264
290
] }
0 commit comments