슬래시 메뉴 키 입력 판별 분리

This commit is contained in:
2026-07-27 12:02:28 +09:00
parent 022cfa2ba5
commit 358199e595
7 changed files with 46 additions and 8 deletions

View File

@@ -51,6 +51,7 @@ import {
getNextSlashHighlightedIndex,
getSlashCommandFocusTarget,
getSlashCommandTextareaSelection,
getSlashMenuKeyboardAction,
insertMarkdownLinesAtSlashTarget,
isMediaSlashAction,
parseSlashInput,
@@ -1451,7 +1452,9 @@ onMounted(() => {
}
if (liveSlashVisible.value) {
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
const slashKeyboardAction = getSlashMenuKeyboardAction(event.key)
if (slashKeyboardAction === 'navigate') {
event.preventDefault()
const count = visibleLiveSlashCommands.value.length
@@ -1472,7 +1475,7 @@ onMounted(() => {
return
}
if (event.key === 'Enter') {
if (slashKeyboardAction === 'apply') {
event.preventDefault()
const command = visibleLiveSlashCommands.value[liveSlashHighlightedIndex.value]
@@ -1483,7 +1486,7 @@ onMounted(() => {
return
}
if (event.key === 'Escape') {
if (slashKeyboardAction === 'cancel') {
event.preventDefault()
cancelLiveSlashCommand()
return