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:
@@ -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()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user