aboutsummaryrefslogtreecommitdiff
path: root/src/components/emoji_input/emoji_input.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2021-02-26 11:13:33 +0000
committerShpuld Shpludson <shp@cock.li>2021-02-26 11:13:33 +0000
commit59db4582b0617f354520886f23047083ec681d54 (patch)
tree1164ac7922d68cd5902b4a9bc3baa0f4afc15f80 /src/components/emoji_input/emoji_input.js
parent20b755d57e790d614036df2ca9ed18207ada02be (diff)
parentacc08932cdc704fd875fbd66180c08c13c243c5e (diff)
Merge branch 'feat/focus-input-with-emoji-pickers' into 'develop'
close #1048: Focus input in emoji picker and react picker Closes #1048 See merge request pleroma/pleroma-fe!1357
Diffstat (limited to 'src/components/emoji_input/emoji_input.js')
-rw-r--r--src/components/emoji_input/emoji_input.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js
index 2068a598..dc03bc9f 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -194,11 +194,18 @@ const EmojiInput = {
}
},
methods: {
+ focusPickerInput () {
+ const pickerEl = this.$refs.picker.$el
+ if (!pickerEl) return
+ const pickerInput = pickerEl.querySelector('input')
+ if (pickerInput) pickerInput.focus()
+ },
triggerShowPicker () {
this.showPicker = true
this.$refs.picker.startEmojiLoad()
this.$nextTick(() => {
this.scrollIntoView()
+ this.focusPickerInput()
})
// This temporarily disables "click outside" handler
// since external trigger also means click originates
@@ -214,6 +221,7 @@ const EmojiInput = {
if (this.showPicker) {
this.scrollIntoView()
this.$refs.picker.startEmojiLoad()
+ this.$nextTick(this.focusPickerInput)
}
},
replace (replacement) {