공개 검색 조합 입력 반영 개선

This commit is contained in:
2026-07-01 10:22:46 +09:00
parent 946bbd5b09
commit e1455e9064
7 changed files with 19 additions and 12 deletions

View File

@@ -38,9 +38,6 @@ const scheduleDebouncedQuery = (value) => {
}
watch(query, (value) => {
if (isComposing.value) {
return
}
scheduleDebouncedQuery(value)
})
@@ -132,8 +129,8 @@ const onCompositionStart = () => {
}
/**
* 입력 이벤트에서 최종 검색어를 갱신한다.
* @param {InputEvent} event - 입력 이벤트
* 입력 이벤트에서 화면에 보이는 검색어를 갱신한다.
* @param {InputEvent | CompositionEvent} event - 입력 이벤트
* @returns {void}
*/
const onInput = (event) => {
@@ -142,10 +139,6 @@ const onInput = (event) => {
return
}
query.value = target.value
if (isComposing.value || event.isComposing) {
clearTimeout(debounceTimer)
return
}
scheduleDebouncedQuery(target.value)
}
@@ -234,6 +227,7 @@ onBeforeUnmount(() => {
class="site-search-modal__input min-w-0 flex-1 bg-transparent py-2 text-lg outline-none placeholder:text-[var(--site-soft)] focus-visible:ring-0 sm:text-[1.35rem]"
placeholder="글 제목, 본문, 태그 검색"
@compositionstart="onCompositionStart"
@compositionupdate="onInput"
@compositionend="onCompositionEnd"
@input="onInput"
/>