From 94f7ae192b8df4f0a8846249016268f914b730bb Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 20 Mar 2024 12:07:02 +0100 Subject: [PATCH] Fix emoji picker placement on limited-height viewports (#29651) --- .../compose/components/emoji_picker_dropdown.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx index acc3fd0ce5..43795d030f 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx @@ -330,6 +330,7 @@ class EmojiPickerDropdown extends PureComponent { state = { active: false, loading: false, + placement: 'bottom', }; setRef = (c) => { @@ -381,10 +382,14 @@ class EmojiPickerDropdown extends PureComponent { return this.target; }; + handleOverlayEnter = (state) => { + this.setState({ placement: state.placement }); + }; + render () { const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis } = this.props; const title = intl.formatMessage(messages.emoji); - const { active, loading } = this.state; + const { active, loading, placement } = this.state; return (
@@ -397,7 +402,7 @@ class EmojiPickerDropdown extends PureComponent { inverted /> - + {({ props, placement })=> (