슬래시 방향키 순환 계산 분리
This commit is contained in:
@@ -48,6 +48,7 @@ import {
|
||||
clampSlashHighlightedIndex,
|
||||
filterSlashCommands,
|
||||
getMediaPickerKindFromSlashAction,
|
||||
getNextSlashHighlightedIndex,
|
||||
getSlashCommandFocusTarget,
|
||||
getSlashCommandTextareaSelection,
|
||||
insertMarkdownLinesAtSlashTarget,
|
||||
@@ -1461,11 +1462,11 @@ onMounted(() => {
|
||||
liveSlashKeyboardNav.value = false
|
||||
}, 200)
|
||||
|
||||
if (event.key === 'ArrowDown') {
|
||||
liveSlashHighlightedIndex.value = (liveSlashHighlightedIndex.value + 1) % count
|
||||
} else {
|
||||
liveSlashHighlightedIndex.value = (liveSlashHighlightedIndex.value - 1 + count) % count
|
||||
}
|
||||
liveSlashHighlightedIndex.value = getNextSlashHighlightedIndex({
|
||||
currentIndex: liveSlashHighlightedIndex.value,
|
||||
commandCount: count,
|
||||
key: event.key
|
||||
})
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user