fix:输入斜杠换出slash菜单后,按方向键向下切换菜单,超出容器可视区后,方向键可以继续切换,但是滚动条不跟随滚动

This commit is contained in:
jingrow 2026-06-06 12:57:05 +08:00
parent 85fcdefeef
commit f86d0b98a7

View File

@ -27,6 +27,14 @@ watch(
() => { selectedIndex.value = 0 },
)
//
watch(selectedIndex, () => {
nextTick(() => {
const active = menuEl.value?.querySelector('.blockeditor-slash-item-active')
if (active) active.scrollIntoView({ block: 'nearest' })
})
})
const groupedItems = computed(() => {
const groups: Record<string, SlashCommandItem[]> = {}
const cats = ['Text', 'Lists', 'Blocks', 'Media']