move keepOpen to picker

This commit is contained in:
Henry Jameson 2022-10-10 00:33:58 +03:00
parent 296a6fa4e3
commit 8fa1f0b50d
2 changed files with 3 additions and 2 deletions

View file

@ -116,7 +116,6 @@ const EmojiInput = {
focused: false,
blurTimeout: null,
temporarilyHideSuggestions: false,
keepOpen: false,
disableClickOutside: false,
suggestions: [],
overlayStyle: {},
@ -344,7 +343,6 @@ const EmojiInput = {
spaceAfter,
after
].join('')
this.keepOpen = keepOpen
this.$emit('update:modelValue', newValue)
const position = this.caret + (insertion + spaceAfter + spaceBefore).length
if (!keepOpen) {

View file

@ -140,6 +140,9 @@ const EmojiPicker = {
},
onEmoji (emoji) {
const value = emoji.imageUrl ? `:${emoji.displayText}:` : emoji.replacement
if (!this.keepOpen) {
this.$refs.popover.hidePopover()
}
this.$emit('emoji', { insertion: value, keepOpen: this.keepOpen })
},
onScroll (e) {