microsoft / microsoft/BotFramework-WebChat
Action.ToggleVisibility in Web Chat creates console.log error
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 1.6k
- Avg merge
- 22h 58m
- Merged PRs (30d)
- 2
Description
Is it an issue related to Adaptive Cards?
Yes, this is an Adaptive Card issue, however it only repro on Web Chat.
Is this an accessibility issue?
No
What version of Web Chat are you using?
Latest production
Which distribution are you using Web Chat from?
NPM
Which hosting environment does this issue primarily affect?
Web apps
Which browsers and platforms do the issue happened?
Browser: Edge (latest), Browser: Chrome (latest), Browser: Firefox (latest)
Which area does this issue affect?
Others or unrelated
What is the public URL for the website?
No response
Please describe the bug
When using the "Action.ToggleVisibility" in an Adaptive Card in the latest WebChat version the console logs the attached error and the action object. The "Action.ToggleVisibility" works as expected.
The error handling seems to be defined in this file:
Do you see any errors in console log?
webchat.js:2 Web Chat: received unknown action from Adaptive Cards
How to reproduce the issue?
- Setup WebChat Frontend with https://github.com/microsoft/BotFramework-WebChat#integrate-with-javascript
- Integrate Backend
- Apply the attached adaptive card to a webchat dialogue
- Trigger the defined dialog in the frontend
- Click the toggle testblock button
- Testblock text toggles its visibilty
- Developer console prints error
What do you expect?
When toggling the visibility via Action.ToggleVisibility I expect the visibility of the elements that are defined to be toggled. Furthermore when this happens as expected i dont expect error logging in the developer console.
What actually happened?
The defined elements visibility is toggled correctly but the developer console print the attached error including the handled action object.
Do you have any screenshots or recordings to repro the issue?
No response
Adaptive Card JSON
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2",
"body": [
{
"id": "name_container",
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Name",
"id": "name_label"
},
{
"type": "Input.Text",
"placeholder": "Name",
"spacing": "None",
"id": "name_input"
}
]
},
{
"id": "toggle_container",
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Testblock",
"wrap": true,
"id": "testblock",
"isVisible": false
},
{
"id": "testblock_toggler",
"type": "ActionSet",
"actions": [
{
"type": "Action.ToggleVisibility",
"title": "Toggle Testblock",
"targetElements": [
"testblock"
],
"style": "positive"
}
]
}
]
}
]
}
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx around the linked error-handling lines. Reproduce the issue using the provided Adaptive Card JSON and the JavaScript Web Chat integration, then verify that Action.ToggleVisibility still toggles the target while no longer printing the unknown-action error or action object to the console.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100