Allow emoji picker to fit smaller viewports (#4651)

* fixed 4493 issue

* Update web/components/chat/ChatTextField/ChatTextField.module.scss

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* lint error fix

---------

Co-authored-by: Gabe Kangas <gabek@real-ity.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
dev-KingMaster
2025-11-10 14:00:11 -08:00
committed by GitHub
co-authored by Copilot Gabe Kangas
parent 8c016b85dd
commit a1f7f599c8
3 changed files with 19 additions and 2 deletions
@@ -80,3 +80,10 @@
cursor: pointer; cursor: pointer;
padding: 0 1rem; padding: 0 1rem;
} }
// Constrain the emoji picker popover to the viewport and allow scrolling.
.emojiPickerContainer {
max-height: 70vh;
max-width: 90vw;
overflow: auto hidden;
}
@@ -276,7 +276,11 @@ export const ChatTextField: FC<ChatTextFieldProps> = ({ defaultText, enabled, fo
{enabled && ( {enabled && (
<div style={{ display: 'flex', paddingLeft: '5px' }}> <div style={{ display: 'flex', paddingLeft: '5px' }}>
<Popover <Popover
content={<EmojiPicker customEmoji={customEmoji} onEmojiSelect={onEmojiSelect} />} content={
<div className={styles.emojiPickerContainer}>
<EmojiPicker customEmoji={customEmoji} onEmojiSelect={onEmojiSelect} />
</div>
}
trigger="click" trigger="click"
placement="topRight" placement="topRight"
> >
@@ -39,6 +39,12 @@ export const EmojiPicker: FC<EmojiPickerProps> = ({ onEmojiSelect, customEmoji }
}, []); }, []);
return ( return (
<Picker data={data} custom={custom} onEmojiSelect={onEmojiSelect} categories={categories} /> <Picker
data={data}
custom={custom}
onEmojiSelect={onEmojiSelect}
categories={categories}
dynamicWidth
/>
); );
}; };