fix(editor): don't open the completion popup on deletion

Backspace/delete/cut emit an input event too, which reopened the
popup mid-edit. Skip the refresh on any delete inputType.
This commit is contained in:
Julien Calixte
2026-06-19 18:53:55 +02:00
parent 5a4fbb452d
commit e726675d77

View File

@@ -147,6 +147,12 @@ function escapeHtml(s: string): string {
function onInput(e: Event) { function onInput(e: Event) {
emit("update:modelValue", (e.target as HTMLTextAreaElement).value) emit("update:modelValue", (e.target as HTMLTextAreaElement).value)
// Deleting text (backspace, forward-delete, cut) shouldn't summon the popup —
// the author is removing, not asking for suggestions. Close it and stop.
if ((e as InputEvent).inputType?.startsWith("delete")) {
completion.value = null
return
}
refresh() refresh()
} }