From 4ad62ae62cdd1b4a9e379307fed3fb2cfd6f4fd3 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 28 Jan 2023 02:16:15 +0100 Subject: [PATCH] Chat: Fix context menu overflow on iOS (#2396) --- src/components/ui/ListItem.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ui/ListItem.tsx b/src/components/ui/ListItem.tsx index 9577d7efc..c3c0e050d 100644 --- a/src/components/ui/ListItem.tsx +++ b/src/components/ui/ListItem.tsx @@ -104,8 +104,9 @@ const ListItem: FC = ({ ); const getMenuElement = useCallback( - () => containerRef.current!.querySelector('.ListItem-context-menu .bubble'), - [], + () => (withPortalForMenu ? document.querySelector('#portals') : containerRef.current)! + .querySelector('.ListItem-context-menu .bubble'), + [withPortalForMenu], ); const getLayout = useCallback(