Do not render unnecessary emoji picker dropdowns

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-04 00:53:20 +02:00
parent 3fdd22e900
commit 8a99d8033c

View file

@ -70,25 +70,27 @@ const EmojiPickerDropdownContainer: React.FC<IEmojiPickerDropdownContainer> = ({
tabIndex={0}
/>)}
<Portal>
<div
className='z-[101]'
ref={refs.setFloating}
style={{
position: strategy,
top: y ?? 0,
left: x ?? 0,
width: 'max-content',
}}
>
<EmojiPickerDropdown
visible={visible}
setVisible={setVisible}
update={update}
{...props}
/>
</div>
</Portal>
{visible && (
<Portal>
<div
className='z-[101]'
ref={refs.setFloating}
style={{
position: strategy,
top: y ?? 0,
left: x ?? 0,
width: 'max-content',
}}
>
<EmojiPickerDropdown
visible
setVisible={setVisible}
update={update}
{...props}
/>
</div>
</Portal>
)}
</div>
);
};