Skip to content

Commit 3ec6857

Browse files
authored
FloatingButton - fix hoisting for iOS (#3983)
* FloatingButton - fix hoisting for iOS * FloatingButton - support edge-to-edge
1 parent 66fa80d commit 3ec6857

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • packages/react-native-ui-lib/src/components/floatingButton

packages/react-native-ui-lib/src/components/floatingButton/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import React, {PropsWithChildren, useEffect, useMemo} from 'react';
22
import {StyleSheet} from 'react-native';
3-
import {asBaseComponent} from '../../commons/new';
3+
import {asBaseComponent, Constants} from '../../commons/new';
44
import {LogService} from '../../services';
55
import {Colors, Shadows, Spacings} from '../../style';
66
import Button, {ButtonProps} from '../button';
7-
import ScreenFooter, {ScreenFooterLayouts, ScreenFooterBackgrounds, KeyboardBehavior, ItemsFit} from '../screenFooter';
7+
import ScreenFooter, {ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, KeyboardBehavior, ItemsFit} from '../screenFooter';
88

99
export enum FloatingButtonLayouts {
1010
VERTICAL = 'Vertical',
1111
HORIZONTAL = 'Horizontal'
1212
}
1313

14-
export interface FloatingButtonProps {
14+
export interface FloatingButtonProps extends Pick<ScreenFooterProps, 'isAndroidEdgeToEdge'> {
1515
/**
1616
* Whether the button is visible
1717
*/
@@ -80,7 +80,8 @@ const FloatingButton = (props: FloatingButtonProps) => {
8080
duration = 300,
8181
withoutAnimation,
8282
hideBackgroundOverlay,
83-
hoisted = true,
83+
hoisted = Constants.isAndroid,
84+
isAndroidEdgeToEdge,
8485
testID
8586
} = props;
8687

@@ -159,6 +160,7 @@ const FloatingButton = (props: FloatingButtonProps) => {
159160
layout={isHorizontal ? ScreenFooterLayouts.HORIZONTAL : ScreenFooterLayouts.VERTICAL}
160161
backgroundType={hideBackgroundOverlay ? ScreenFooterBackgrounds.TRANSPARENT : ScreenFooterBackgrounds.FADING}
161162
keyboardBehavior={hoisted ? KeyboardBehavior.HOISTED : KeyboardBehavior.STICKY}
163+
isAndroidEdgeToEdge={isAndroidEdgeToEdge}
162164
animationDuration={withoutAnimation ? 0 : duration}
163165
itemsFit={fullWidth ? ItemsFit.STRETCH : undefined}
164166
contentContainerStyle={footerContentContainerStyle}

0 commit comments

Comments
 (0)