Open arunachalamv-cyberinnov opened 3 months ago
I figured out that the Chatbot component provides a validator function. Chatbot properties That function allows you to specify what needs to be considered as a message.
So for your case, it will be like-
const validateInput = (input) =>{
return input.length > 0 && input.trim().length !=0;
}
<Chatbot
//other configurations
validator={validateInput}
/>
It will prevent the message from being sent.
Worked
I figured out that the Chatbot component provides a validator function. Chatbot properties That function allows you to specify what needs to be considered as a message.
So for your case, it will be like-
const validateInput = (input) =>{ return input.length > 0 && input.trim().length !=0; } <Chatbot //other configurations validator={validateInput} />
It will prevent the message from being sent.
Thanks @devo-id to pointing that out.