From d2fabe1a71207f92e10283fc5a881d883cb52ae1 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 10 Oct 2022 00:37:59 +0300 Subject: [PATCH] use anchor for picker --- src/components/emoji_input/emoji_input.js | 2 ++ src/components/emoji_picker/emoji_picker.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js index 6532654f..eb64e054 100644 --- a/src/components/emoji_input/emoji_input.js +++ b/src/components/emoji_input/emoji_input.js @@ -141,6 +141,7 @@ const EmojiInput = { return this.focused && this.suggestions && this.suggestions.length > 0 && + !this.pickerShown && !this.temporarilyHideSuggestions }, textAtCaret () { @@ -205,6 +206,7 @@ const EmojiInput = { this.input = input this.caretEl = hiddenOverlayCaret suggestorPopover.setAnchorEl(this.caretEl) + this.$refs.picker.setAnchorEl(this.caretEl) const style = getComputedStyle(this.input) this.overlayStyle.padding = style.padding this.overlayStyle.border = style.border diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 3fad4601..e907def9 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -113,13 +113,15 @@ const EmojiPicker = { }, methods: { showPicker () { - console.log('pick') this.$refs.popover.showPopover() this.onShowing() }, hidePicker () { this.$refs.popover.hidePopover() }, + setAnchorEl (el) { + this.$refs.popover.setAnchorEl(el) + }, setGroupRef (name) { return el => { this.groupRefs[name] = el } },