Fix focus on NewToot/Status
This commit is contained in:
parent
f636fd6c92
commit
88422646e7
|
@ -71,7 +71,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import 'emoji-mart-vue-fast/css/emoji-mart.css'
|
import 'emoji-mart-vue-fast/css/emoji-mart.css'
|
||||||
import data from 'emoji-mart-vue-fast/data/all.json'
|
import data from 'emoji-mart-vue-fast/data/all.json'
|
||||||
import { defineComponent, computed, toRefs, ref, onBeforeUnmount, onMounted } from 'vue'
|
import { defineComponent, computed, toRefs, ref, onBeforeUnmount, onMounted, nextTick } from 'vue'
|
||||||
import { Picker, EmojiIndex } from 'emoji-mart-vue-fast/src'
|
import { Picker, EmojiIndex } from 'emoji-mart-vue-fast/src'
|
||||||
import { useMagicKeys, whenever } from '@vueuse/core'
|
import { useMagicKeys, whenever } from '@vueuse/core'
|
||||||
|
|
||||||
|
@ -129,13 +129,13 @@ export default defineComponent({
|
||||||
})
|
})
|
||||||
|
|
||||||
whenever(up, () => {
|
whenever(up, () => {
|
||||||
suggestHighlight(highlightedIndex.value - 1)
|
if (suggestOpened.value) suggestHighlight(highlightedIndex.value - 1)
|
||||||
})
|
})
|
||||||
whenever(down, () => {
|
whenever(down, () => {
|
||||||
suggestHighlight(highlightedIndex.value + 1)
|
if (suggestOpened.value) suggestHighlight(highlightedIndex.value + 1)
|
||||||
})
|
})
|
||||||
whenever(enter, () => {
|
whenever(enter, () => {
|
||||||
selectCurrentItem()
|
if (suggestOpened.value) selectCurrentItem()
|
||||||
})
|
})
|
||||||
whenever(escape, () => {
|
whenever(escape, () => {
|
||||||
closeSuggest()
|
closeSuggest()
|
||||||
|
@ -148,8 +148,10 @@ export default defineComponent({
|
||||||
closeSuggest()
|
closeSuggest()
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
statusRef.value?.focus()
|
statusRef.value?.focus()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const openSuggest = () => {
|
const openSuggest = () => {
|
||||||
suggestOpened.value = true
|
suggestOpened.value = true
|
||||||
|
|
Loading…
Reference in New Issue