Skip to content

Commit c21b732

Browse files
fix(mobile): keep suggestion height cleanup with its portal
1 parent c4249b1 commit c21b732

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎apps/mobile/src/features/threads/ComposerPopoverAnchor.android.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ export function ComposerPopoverAnchor(props: { readonly children: ReactNode }) {
1717
const anchorRef = useRef<ViewInstance>(null);
1818
const [frame, setFrame] = useState<Frame | null>(null);
1919
const popoverHeight = host?.popoverHeight;
20-
useEffect(
21-
() => () => {
22-
popoverHeight?.set(0);
23-
},
24-
[popoverHeight],
25-
);
2620

2721
const measure = () => {
2822
const hostView = host?.hostRef.current;
@@ -61,7 +55,13 @@ export function ComposerPopoverAnchor(props: { readonly children: ReactNode }) {
6155
});
6256

6357
const setHostContent = host?.setContent;
64-
useEffect(() => () => setHostContent?.(null), [setHostContent]);
58+
useEffect(
59+
() => () => {
60+
setHostContent?.(null);
61+
popoverHeight?.set(0);
62+
},
63+
[setHostContent, popoverHeight],
64+
);
6565

6666
if (host === null) {
6767
return <View className="absolute inset-x-0 bottom-full z-10 mb-2">{props.children}</View>;

‎apps/mobile/src/features/threads/ThreadDetailScreen.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,6 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
657657
{ duration: 180, easing: Easing.out(Easing.cubic), reduceMotion: ReduceMotion.System },
658658
),
659659
);
660-
// Keep the status above expanded questions and composer suggestions.
661-
// Suggestions remain overlays, so opening them does not move the feed.
662660
const floatingControlLift = useDerivedValue(
663661
() =>
664662
Math.max(

0 commit comments

Comments
 (0)