Skip to content

Commit 7d64f1c

Browse files
committed
Fix SearchRouterModal position with help panel open on wide web view
1 parent 06c212e commit 7d64f1c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/components/Modal/BaseModal.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ function BaseModal(
116116

117117
const {sidePanelOffset} = useSidePanel();
118118
const sidePanelStyle = !shouldUseReanimatedModal && shouldApplySidePanelOffset && !isSmallScreenWidth ? {paddingRight: sidePanelOffset.current} : undefined;
119-
const sidePanelReanimatedStyle =
120-
shouldUseReanimatedModal && shouldApplySidePanelOffset && !isSmallScreenWidth ? {transform: [{translateX: Animated.multiply(sidePanelOffset.current, -1)}]} : undefined;
119+
const sidePanelAnimatedStyle =
120+
(shouldUseReanimatedModal || type === CONST.MODAL.MODAL_TYPE.POPOVER) && shouldApplySidePanelOffset && !isSmallScreenWidth
121+
? {transform: [{translateX: Animated.multiply(sidePanelOffset.current, -1)}]}
122+
: undefined;
121123
const keyboardStateContextValue = useKeyboardState();
122124

123125
const [modalOverlapsWithTopSafeArea, setModalOverlapsWithTopSafeArea] = useState(false);
@@ -415,7 +417,7 @@ function BaseModal(
415417
>
416418
<Animated.View
417419
onLayout={onViewLayout}
418-
style={[styles.defaultModalContainer, modalContainerStyle, modalPaddingStyles, !isVisible && styles.pointerEventsNone, sidePanelReanimatedStyle]}
420+
style={[styles.defaultModalContainer, modalContainerStyle, modalPaddingStyles, !isVisible && styles.pointerEventsNone, sidePanelAnimatedStyle]}
419421
ref={ref}
420422
>
421423
<ColorSchemeWrapper>{children}</ColorSchemeWrapper>

0 commit comments

Comments
 (0)