한글 입력 중 블록 패널 유지 조건 수정

This commit is contained in:
2026-07-24 17:13:06 +09:00
parent 8abe130f8d
commit 4b800d6d2e
5 changed files with 35 additions and 6 deletions

View File

@@ -196,7 +196,7 @@ watch(markdownValue, () => {
if (activeMode.value !== 'write'
|| !textarea
|| import.meta.client && document.activeElement !== textarea) {
|| (import.meta.client && document.activeElement !== textarea)) {
writeModeContextValue.value = null
}
})
@@ -410,6 +410,26 @@ const activeBlockContext = computed(() => resolveActiveBlockContext(
/** @deprecated 내부 호환 alias */
const activeMediaBlock = activeBlockContext
/**
* 지정 줄이 블록 컨텍스트 범위 안에 있는지 확인한다.
* @param {Object|null} context - 블록 컨텍스트
* @param {number} lineIndex - 현재 논리 줄
* @returns {boolean}
*/
const isLineInsideBlockContext = (context, lineIndex) => {
if (!context) {
return false
}
const startLine = Number(context.startLine)
const endLine = Number(context.endLine)
return Number.isInteger(startLine)
&& Number.isInteger(endLine)
&& lineIndex >= startLine
&& lineIndex <= endLine
}
/**
* IME 조합 중에는 일시적으로 블록 판별이 비어도 직전 패널을 유지한다.
* @returns {Object|null} 패널 표시용 블록 컨텍스트
@@ -423,7 +443,12 @@ const visibleBlockContext = computed(() => {
return activeBlockContext.value
}
return isTextComposing.value ? lastStableBlockContext.value : null
if (isTextComposing.value
&& isLineInsideBlockContext(lastStableBlockContext.value, activeLogicalLineIndex.value)) {
return lastStableBlockContext.value
}
return null
})
/**