Skip to content

Commit

Permalink
refs#10866 IME入力セッション中はEscapeキーが来ても投稿ダイアログを閉じない
Browse files Browse the repository at this point in the history
  • Loading branch information
yuba authored Oct 18, 2024
1 parent b1aac6a commit e489fe4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/frontend/src/components/MkPostForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ const recentHashtags = ref(JSON.parse(miLocalStorage.getItem('hashtags') ?? '[]'
const imeText = ref('');
const showingOptions = ref(false);
const textAreaReadOnly = ref(false);
comst composing = ref(false);

const draftKey = computed((): string => {
let key = props.channel ? `channel:${props.channel.id}` : '';
Expand Down Expand Up @@ -573,15 +574,17 @@ function clear() {
function onKeydown(ev: KeyboardEvent) {
if (ev.key === 'Enter' && (ev.ctrlKey || ev.metaKey) && canPost.value) post();

if (ev.key === 'Escape') emit('esc');
if (ev.key === 'Escape' && !composing.value) emit('esc');
}

function onCompositionUpdate(ev: CompositionEvent) {
imeText.value = ev.data;
composing.value = true;
}

function onCompositionEnd(ev: CompositionEvent) {
imeText.value = '';
composing.value = false;
}

async function onPaste(ev: ClipboardEvent) {
Expand Down

0 comments on commit e489fe4

Please sign in to comment.