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 1d96427f6b1..ad769fe9244 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.jsx @@ -61,8 +61,14 @@ class ModifierPickerMenu extends PureComponent { this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1); }; - UNSAFE_componentWillReceiveProps(nextProps) { - if (nextProps.active) { + componentDidMount() { + if (this.props.active) { + this.attachListeners(); + } + } + + componentDidUpdate() { + if (this.props.active) { this.attachListeners(); } else { this.removeListeners();