diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2023-12-04 18:12:14 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-04 18:12:14 +0900 |
| commit | e90ad095516bfd6c363596c9262f4269359d48c3 (patch) | |
| tree | 576473881473bbb732662f70554779f117a16809 /packages/frontend/src/components/MkPostForm.vue | |
| parent | chore: 自分へのリプライのみ走査するように (#12570) (diff) | |
| download | misskey-e90ad095516bfd6c363596c9262f4269359d48c3.tar.gz misskey-e90ad095516bfd6c363596c9262f4269359d48c3.tar.bz2 misskey-e90ad095516bfd6c363596c9262f4269359d48c3.zip | |
fix (frontend): 絵文字ピッカー経由で投稿欄に絵文字を入れた際、ソフトウェアキーボードが立ち上がらないようにする (#12561)
Diffstat (limited to 'packages/frontend/src/components/MkPostForm.vue')
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 0445536ae5..13b615d104 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only <MkInfo v-if="hasNotSpecifiedMentions" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo> <input v-show="useCw" ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown"> <div :class="[$style.textOuter, { [$style.withCw]: useCw }]"> - <textarea ref="textareaEl" v-model="text" :class="[$style.text]" :disabled="posting || posted" :placeholder="placeholder" data-cy-post-form-text @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/> + <textarea ref="textareaEl" v-model="text" :class="[$style.text]" :disabled="posting || posted" :readonly="textAreaReadOnly" :placeholder="placeholder" data-cy-post-form-text @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/> <div v-if="maxTextLength - textLength < 100" :class="['_acrylic', $style.textCount, { [$style.textOver]: textLength > maxTextLength }]">{{ maxTextLength - textLength }}</div> </div> <input v-show="withHashtags" ref="hashtagsInputEl" v-model="hashtags" :class="$style.hashtags" :placeholder="i18n.ts.hashtags" list="hashtags"> @@ -98,7 +98,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script lang="ts" setup> -import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide } from 'vue'; +import { inject, watch, nextTick, onMounted, defineAsyncComponent, provide, ref } from 'vue'; import * as mfm from 'mfm-js'; import * as Misskey from 'misskey-js'; import insertTextAtCursor from 'insert-text-at-cursor'; @@ -195,6 +195,7 @@ let hasNotSpecifiedMentions = $ref(false); let recentHashtags = $ref(JSON.parse(miLocalStorage.getItem('hashtags') ?? '[]')); let imeText = $ref(''); let showingOptions = $ref(false); +const textAreaReadOnly = ref(false); const draftKey = $computed((): string => { let key = props.channel ? `channel:${props.channel.id}` : ''; @@ -846,12 +847,15 @@ function insertMention() { } async function insertEmoji(ev: MouseEvent) { + textAreaReadOnly.value = true; + emojiPicker.show( ev.currentTarget ?? ev.target, emoji => { insertTextAtCursor(textareaEl, emoji); }, () => { + textAreaReadOnly.value = false; focus(); }, ); |