summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-10-31 10:19:12 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-10-31 10:19:12 +0900
commitb64d3af1f3b79fdb1bef165fc206cfb00dc4a688 (patch)
tree110f5074a98e50900b0e9975193845b6d340756d /src
parentAPI: blocking/create or deleteで完全なUser情報を返すように (diff)
parent補完でタブが効かなくなるケースを修正 (#6779) (diff)
downloadsharkey-b64d3af1f3b79fdb1bef165fc206cfb00dc4a688.tar.gz
sharkey-b64d3af1f3b79fdb1bef165fc206cfb00dc4a688.tar.bz2
sharkey-b64d3af1f3b79fdb1bef165fc206cfb00dc4a688.zip
Merge branch 'develop' of https://github.com/syuilo/misskey into develop
Diffstat (limited to 'src')
-rw-r--r--src/client/components/autocomplete.vue13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/components/autocomplete.vue b/src/client/components/autocomplete.vue
index 7f4b565723..476be8ae78 100644
--- a/src/client/components/autocomplete.vue
+++ b/src/client/components/autocomplete.vue
@@ -122,6 +122,7 @@ export default defineComponent({
users: [],
hashtags: [],
emojis: [],
+ items: [],
select: -1,
emojilist,
emojiDb: [] as EmojiDef[]
@@ -129,10 +130,6 @@ export default defineComponent({
},
computed: {
- items(): HTMLCollection {
- return (this.$refs.suggests as Element).children;
- },
-
useOsNativeEmojis(): boolean {
return this.$store.state.device.useOsNativeEmojis;
}
@@ -148,6 +145,7 @@ export default defineComponent({
updated() {
this.setPosition();
+ this.items = (this.$refs.suggests as Element | undefined)?.children || [];
},
mounted() {
@@ -371,6 +369,7 @@ export default defineComponent({
selectNext() {
if (++this.select >= this.items.length) this.select = 0;
+ if (this.items.length === 0) this.select = -1;
this.applySelect();
},
@@ -384,8 +383,10 @@ export default defineComponent({
el.removeAttribute('data-selected');
}
- this.items[this.select].setAttribute('data-selected', 'true');
- (this.items[this.select] as any).focus();
+ if (this.select !== -1) {
+ this.items[this.select].setAttribute('data-selected', 'true');
+ (this.items[this.select] as any).focus();
+ }
},
chooseUser() {