Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button click answer does not show button elements in reply #13

Open
danbergan opened this issue Apr 16, 2018 · 2 comments
Open

button click answer does not show button elements in reply #13

danbergan opened this issue Apr 16, 2018 · 2 comments

Comments

@danbergan
Copy link

When a user clicks a button in response to a question, a reply containing ElementButtons will not be shown (any text in the ButtonTemplate will be shown). Typing, rather than clicking, will show the ElementButton.

Further, two successive button click responses by a user will then cause a javascript error and no part of the ButtonTemplate will be shown in the reply. (see comments in attached files.)

A simple proof of the bug in the attached files.
botman.php.txt
Conversation.php.txt
anotherConversation.php.txt

@danbergan
Copy link
Author

It looks like if a user clicks a button in a question, the msg.buttons array is not passed to the message handler:

performAction(action: IAction) {
botman.callAPI(action.value, true, null, (msg: IMessage) => {
this.state.attachmentsVisible = false;
this.props.messageHandler({
text: msg.text,
type: msg.type,
timeout: msg.timeout,
actions: msg.actions,
attachment: msg.attachment,
additionalParameters: msg.additionalParameters,
from: 'chatbot'
});
}, null);
}
I added:
buttons: msg.buttons,

and, it fixed my bug. I'll try to do a pull request soon (but, I'm a bit of newbie with git, so I'll see if I can figure it out!)

@EranGrin
Copy link

I created a new package that solves this and several other issues
https://www.npmjs.com/package/botman-extended-web-widget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants