From 7072401f18a6a89d7b0d9078f382db9dcde65c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 20 Sep 2024 21:03:14 +0200 Subject: [PATCH] pl-fe: fix refs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../ui/components/modals/familiar-followers-modal.tsx | 1 + .../src/features/ui/components/modals/favourites-modal.tsx | 1 + .../src/features/ui/components/modals/mentions-modal.tsx | 6 +++++- .../src/features/ui/components/modals/reactions-modal.tsx | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/pl-fe/src/features/ui/components/modals/familiar-followers-modal.tsx b/packages/pl-fe/src/features/ui/components/modals/familiar-followers-modal.tsx index 48575c01e1..0596f88c28 100644 --- a/packages/pl-fe/src/features/ui/components/modals/familiar-followers-modal.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/familiar-followers-modal.tsx @@ -58,6 +58,7 @@ const FamiliarFollowersModal: React.FC } onClose={onClickClose} + ref={modalRef} > {body} diff --git a/packages/pl-fe/src/features/ui/components/modals/favourites-modal.tsx b/packages/pl-fe/src/features/ui/components/modals/favourites-modal.tsx index 13320f8810..5cca93b988 100644 --- a/packages/pl-fe/src/features/ui/components/modals/favourites-modal.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/favourites-modal.tsx @@ -68,6 +68,7 @@ const FavouritesModal: React.FC = ({ onCl } onClose={onClickClose} + ref={modalRef} > {body} diff --git a/packages/pl-fe/src/features/ui/components/modals/mentions-modal.tsx b/packages/pl-fe/src/features/ui/components/modals/mentions-modal.tsx index 019809239b..6ab36dc96e 100644 --- a/packages/pl-fe/src/features/ui/components/modals/mentions-modal.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/mentions-modal.tsx @@ -1,5 +1,5 @@ import { OrderedSet as ImmutableOrderedSet } from 'immutable'; -import React, { useCallback, useEffect } from 'react'; +import React, { useCallback, useEffect, useRef } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { fetchStatusWithContext } from 'pl-fe/actions/statuses'; @@ -16,6 +16,7 @@ interface MentionsModalProps { } const MentionsModal: React.FC = ({ onClose, statusId }) => { + const modalRef = useRef(null); const dispatch = useAppDispatch(); const intl = useIntl(); const getStatus = useCallback(makeGetStatus(), []); @@ -45,6 +46,8 @@ const MentionsModal: React.FC = ({ onClose, listClassName='max-w-full' itemClassName='pb-3' estimatedSize={42} + useWindowScroll={false} + parentRef={modalRef} > {accountIds.map(id => , @@ -57,6 +60,7 @@ const MentionsModal: React.FC = ({ onClose, } onClose={onClickClose} + ref={modalRef} > {body} diff --git a/packages/pl-fe/src/features/ui/components/modals/reactions-modal.tsx b/packages/pl-fe/src/features/ui/components/modals/reactions-modal.tsx index d73cb69a60..1e7ee45b77 100644 --- a/packages/pl-fe/src/features/ui/components/modals/reactions-modal.tsx +++ b/packages/pl-fe/src/features/ui/components/modals/reactions-modal.tsx @@ -109,6 +109,7 @@ const ReactionsModal: React.FC = ({ onClos } onClose={onClickClose} + ref={modalRef} > {body}