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