fix: reset startInputType after form submission ( #334 )#374
Open
SyncWithRaj wants to merge 1 commit intoFlowiseAI:mainfrom
Open
fix: reset startInputType after form submission ( #334 )#374SyncWithRaj wants to merge 1 commit intoFlowiseAI:mainfrom
SyncWithRaj wants to merge 1 commit intoFlowiseAI:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the autoSendInitialMessage feature, allowing the chatbot to automatically trigger a message upon loading if specific conditions are met, such as no lead capture being required. The changes span the core Bot component, where the auto-send logic and state management are implemented, as well as the Bubble and Full components to support the new theme property. Additionally, a fix was included to reset the input type after form submissions. Feedback suggests improving the reliability of the lead capture check by using the configuration object directly and adding a guard to prevent auto-sending if the user has already started typing.
5c99465 to
2b1e8cc
Compare
2b1e8cc to
ab18fc0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a chat agent flow has form inputs, the initial form submission works perfectly, but subsequent standard chat messages from the user fail to attach to the API payload. The client sends an empty
{form: {}}object instead of the{question: "user text"}string.Root Cause
The
startInputTypestate is set to'formInput'when the chatbot configuration loads, but it is never reset after the form is successfully submitted. This causes the widget to perpetually act as if it is in a form-submission state.Fix
Added
setStartInputType('')insidehandleSubmit()immediately after the form payload is constructed and processed. This resets the input state, ensuring that all subsequent user messages are correctly treated as standard text questions.Testing
{form: {Var1: "test"}}{question: "user text"}Fixes #334