mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-26 05:33:43 +01:00
[Glitch] Fixed the toggle emoji dropdown bug
Port 1467f1e1e1
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
dfd74f0dae
commit
4d6844eb2f
1 changed files with 4 additions and 1 deletions
|
@ -165,6 +165,7 @@ class EmojiPickerMenuImpl extends PureComponent {
|
|||
intl: PropTypes.object.isRequired,
|
||||
skinTone: PropTypes.number.isRequired,
|
||||
onSkinTone: PropTypes.func.isRequired,
|
||||
pickerButtonRef: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
|
@ -179,7 +180,7 @@ class EmojiPickerMenuImpl extends PureComponent {
|
|||
};
|
||||
|
||||
handleDocumentClick = e => {
|
||||
if (this.node && !this.node.contains(e.target)) {
|
||||
if (this.node && !this.node.contains(e.target) && !this.props.pickerButtonRef.contains(e.target)) {
|
||||
this.props.onClose();
|
||||
}
|
||||
};
|
||||
|
@ -234,6 +235,7 @@ class EmojiPickerMenuImpl extends PureComponent {
|
|||
emoji.native = emoji.colons;
|
||||
}
|
||||
if (!(event.ctrlKey || event.metaKey)) {
|
||||
|
||||
this.props.onClose();
|
||||
}
|
||||
this.props.onPick(emoji);
|
||||
|
@ -409,6 +411,7 @@ class EmojiPickerDropdown extends PureComponent {
|
|||
onSkinTone={onSkinTone}
|
||||
skinTone={skinTone}
|
||||
frequentlyUsedEmojis={frequentlyUsedEmojis}
|
||||
pickerButtonRef={this.target}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue