xatkit-bot-platform / xatkit-chat-widget

(React) Chat widget for Xatkit
https://xatkit.com
MIT License
5 stars 2 forks source link

Ignore user inputs when toggleMsgLoader is true #49

Open gdaniel opened 4 years ago

gdaniel commented 4 years ago

User inputs are still sent to the server when the bot prints the message loader, and the inputs will be handled as if they follow the message currently being printed. This may be an issue if the bot asks a question with buttons, because the user reply will be off tracks.

A simple solution would be to disable user input handling when the bot is printing the message loader.

hamzaed commented 4 years ago

We can disable the submit button when toggleMsgLoader is true. We should also deal with the key enter which also triggers the the submit event.

gdaniel commented 4 years ago

First version: disable submit / enter. We'll rethink the message loader in the future.