fix(editor): close completion popup after accepting a value

Accepting an enum value (e.g. "on-track") re-ran the chained refresh,
which re-matched the value and reopened the popup. Chain only after
completing a key, when there are still values to offer.
This commit is contained in:
Julien Calixte
2026-06-19 18:53:44 +02:00
parent d26ebeef71
commit 5a4fbb452d

View File

@@ -87,7 +87,9 @@ function accept(i: number) {
nextTick(() => { nextTick(() => {
el.setSelectionRange(caret, caret) el.setSelectionRange(caret, caret)
el.focus() el.focus()
refresh() // chain, e.g. `status = ` immediately offers the enum values // Chain only after completing a key (insert ends `= `), so its values pop
// up next. A value or header is terminal — re-running would re-offer it.
if (item.insert.endsWith("= ")) refresh()
}) })
} }