Forum Discussion
[Adaptive Card] Issue with rendering images and ToggleVisibility
I am using a simple accordion style adaptive card with a collapsible section:
{
"type": "AdaptiveCard",
"$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "Title",
"wrap": true,
"size": "Medium"
}
],
"width": "stretch"
},
{
"type": "Column",
"id": "chevronDown",
"spacing": "Small",
"verticalContentAlignment": "Center",
"items": [
{
"type": "Image",
"url": "https://adaptivecards.io/content/down.png",
"width": "20px",
"altText": "collapsed"
}
],
"width": "auto"
},
{
"type": "Column",
"id": "chevronUp",
"spacing": "Small",
"verticalContentAlignment": "Center",
"items": [
{
"type": "Image",
"url": "https://adaptivecards.io/content/up.png",
"width": "20px",
"altText": "expanded"
}
],
"width": "auto",
"isVisible": false
}
],
"selectAction": {
"type": "Action.ToggleVisibility",
"targetElements": [
"cardContent",
"chevronUp",
"chevronDown"
]
}
},
{
"type": "Container",
"id": "cardContent",
"isVisible": false,
"items": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Text"
}
]
}
]
}
],
"separator": true,
"spacing": "Medium"
}
]
}
On the initial load, the image (down arrow) gets rendered properly.
If I click on it, the collapsed section opens (and the down arrow gets hidden and replaced by the up arrow).
However, if I collapse the accordion again, the following happens:
And it stays like this until I restart the Teams client.
Looking at the devtools network tab for the web client the following behavior can be observed:
During the initial load (1) the down.png gets fetched and stored in memory. You can also see the result on the right. If I extend the component (2), the up.png gets fetched and stored in memory. If I then collapse the section again (3), the call to memory for the down arrow fails with
GET blob:https://teams.microsoft.com/51e89b2e-7da4-4c80-bf98-a6ee4d257052 net::ERR_FILE_NOT_FOUND
It happens in both the standalone client and the web version. Also for multiple users (so it is not just some caching issue on my side).
It seems to me that toggling the visibility somehow removes the images from memory. But it only happens for images that are initially visible (it doesn't happen for the up arrow in my case).
1 Reply
- Prasad_Das-MSFT
Microsoft
Hi nscharmacher​, we are able to repro this issue. We have raised a bug for the same. We will inform you once we get any further update from engineering team. Thanks!