Fix send button not enabling after revert/undo

When restoring message text to prompt input after revert/undo, dispatch input event to trigger textarea's onInput handler. This updates the prompt signal and enables the send button immediately.
This commit is contained in:
Shantur Rathore
2025-10-24 17:48:03 +01:00
parent 1362a5872a
commit d7e3ae4624

View File

@@ -101,6 +101,7 @@ const SessionView: Component<{
const textarea = document.querySelector(".prompt-input") as HTMLTextAreaElement
if (textarea) {
textarea.value = textParts.map((p: any) => p.text).join("\n")
textarea.dispatchEvent(new Event("input", { bubbles: true }))
textarea.focus()
}
}
@@ -469,6 +470,7 @@ const App: Component = () => {
const textarea = document.querySelector(".prompt-input") as HTMLTextAreaElement
if (textarea) {
textarea.value = textParts.map((p: any) => p.text).join("\n")
textarea.dispatchEvent(new Event("input", { bubbles: true }))
textarea.focus()
}
}