Performance: hide EmojiSelector until portaled

This commit is contained in:
Alex Gleason 2023-02-14 11:20:25 -06:00
parent ec2235011f
commit 0aeeeb1dc4
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 22 additions and 18 deletions

View File

@ -105,6 +105,7 @@ const StatusReactionWrapper: React.FC<IStatusReactionWrapper> = ({ statusId, chi
ref: setReferenceElement, ref: setReferenceElement,
})} })}
{visible && (
<Portal> <Portal>
<EmojiSelector <EmojiSelector
placement='top-start' placement='top-start'
@ -113,6 +114,7 @@ const StatusReactionWrapper: React.FC<IStatusReactionWrapper> = ({ statusId, chi
visible={visible} visible={visible}
/> />
</Portal> </Portal>
)}
</div> </div>
); );
}; };

View File

@ -37,6 +37,7 @@ function ChatMessageReactionWrapper(props: IChatMessageReactionWrapper) {
onClick: onToggleVisibility, onClick: onToggleVisibility,
})} })}
{isOpen && (
<Portal> <Portal>
<EmojiSelector <EmojiSelector
visible={isOpen} visible={isOpen}
@ -47,6 +48,7 @@ function ChatMessageReactionWrapper(props: IChatMessageReactionWrapper) {
all={false} all={false}
/> />
</Portal> </Portal>
)}
</React.Fragment> </React.Fragment>
); );
} }