슬래시 메뉴 키 입력 판별 분리
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user