Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

補完でタブが効かなくなるケースを修正 #6779

Merged
merged 1 commit into from Oct 31, 2020

Conversation

takonomura
Copy link
Contributor

Summary

文章中の絵文字などの補完で、タブが効かなくなってしまうケースがあるのを修正します。

具体的には以下の手順で再現できます。

  1. :thumbs などと書いて補完候補が出る (ここでタブを押すとそれが正しく選択される)
  2. そこから :thumbsaaa などと補完候補が無くなるような文字を書く
  3. 最後の aaa を消して :thumbs に戻ると再び補完候補が表示される
  4. しかし、そこでタブを押しても候補が選択されず、背景色が変わらない

原因は

https://github.com/syuilo/misskey/blob/629b765abcab091c2a0d30ef5e881d28e2badf02/src/client/components/autocomplete.vue#L18

の行の v-if が false になるため、 this.$refs.suggests が示す要素が無くなり、その結果 computed である items

https://github.com/syuilo/misskey/blob/629b765abcab091c2a0d30ef5e881d28e2badf02/src/client/components/autocomplete.vue#L131-L134

が更新されなくなってしまうようです。

@syuilo
Copy link
Member

syuilo commented Oct 31, 2020

ありがとうございます!
$refsをcomputed内で使うなというのはVueの基本でしたね... 失念していました。

@syuilo syuilo merged commit 3bfae80 into misskey-dev:develop Oct 31, 2020
@syuilo
Copy link
Member

syuilo commented Oct 31, 2020

🙏🙏🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants