From 27de7a8b4ebf3c6ebf986be992bfb0841b9d4d91 Mon Sep 17 00:00:00 2001 From: retoor Date: Wed, 25 Jun 2025 22:46:07 +0200 Subject: [PATCH] Update. --- src/snek/static/stt.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/snek/static/stt.js b/src/snek/static/stt.js index f5174a0..0184c4f 100644 --- a/src/snek/static/stt.js +++ b/src/snek/static/stt.js @@ -66,7 +66,10 @@ this.recog.onresult = (e) => { /* --- paint to DOM --- */ if (this.targetEl) { - this.targetEl.setAttribute("value",committed + interim) + this.targetEl.focus() + + this.targetEl.value = committed + interim + /*this.targetElement.dispatchEvent(new ChangeEvent('change', { bubbles: true, cancelable: true @@ -94,7 +97,7 @@ this.recog.onresult = (e) => { //if (name === 'target') this.targetEl = document.querySelector(newVal); } - get targetEl() { return document.activeElement || null; } + get targetEl() { return document.querySelector("textarea") || null; } connectedCallback() { // initial target lookup