Skip to content

Commit 5c99465

Browse files
committed
fix: reset startInputType after form submission (#334)
After initial form submission, startInputType stayed as 'formInput' permanently, causing subsequent text messages to send empty form objects instead of the user's question. Reset startInputType to '' after form data is processed.
1 parent b511bff commit 5c99465

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

dist/components/Bot.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Bot.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,8 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
12531253
if (startInputType() === 'formInput' && Object.keys(formData).length > 0) {
12541254
body.form = formData;
12551255
delete body.question;
1256+
// Reset after form submission so subsequent messages use question-based payload
1257+
setStartInputType('');
12561258
}
12571259

12581260
if (uploads && uploads.length > 0) body.uploads = uploads;

0 commit comments

Comments
 (0)