This commit is contained in:
retoor 2025-06-29 21:03:33 +02:00
parent 88bb78fb23
commit c05bd57fe1

View File

@ -97,7 +97,7 @@ class STTButton extends HTMLElement {
.replace(/\!/g, "!\n"); .replace(/\!/g, "!\n");
this.targetEl.value = ''; // punctuated; this.targetEl.value = ''; // punctuated;
this.simulateTypingWithEvents(this.targetEl, punctuated, 1).then(() => { this.simulateTypingWithEvents(this.targetEl, punctuated, 0).then(() => {
const chatInput = document.querySelector('chat-input'); const chatInput = document.querySelector('chat-input');
chatInput.finalizeMessage(); chatInput.finalizeMessage();
}); });
@ -116,15 +116,16 @@ class STTButton extends HTMLElement {
el.focus(); el.focus();
if (el.isContentEditable) { if (el.isContentEditable) {
el.innerText = el.innerText.replace(new RegExp(previousInterim + '$'), interim); el.innerText = el.innerText.replace(new RegExp(previousInterim + '$'), '');
} else { } else {
el.value = interim el.value = ''
// el.value = interim
//el.value = el.value.replace(new RegExp(previousInterim + '$'), interim); //el.value = el.value.replace(new RegExp(previousInterim + '$'), interim);
} }
/*
this.simulateTypingWithEvents(el, interim, 0).then(() => { this.simulateTypingWithEvents(el, interim, 0).then(() => {
previousInterim = interim; previousInterim = interim;
});*/ });
} }
}; };