microsoft / microsoft/AdaptiveCards

Widgets: Setting selectAction on Adaptive Card root forces all content to be vertically aligned

Open
#9,345 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Describe the bug

When specifying a selectAction on an Adaptive Card for the Widget Board, it always centers its content vertically, no matter what "height": "stretch" or "verticalContentAlignment": "Bottom" values I specify in the JSON.

Steps to reproduce the bug

Use this Adaptive Card template:

  {
      "type": "AdaptiveCard",
      "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
      "version": "1.5",
      "header": null,
      "body": [
          {
              "type": "Container",
              "items": [
                  {
                      "type": "TextBlock",
                      "text": "some text"
                  }
              ],
              "height": "stretch",
              "verticalContentAlignment": "Bottom"
          },
          {
              "type": "TextBlock",
              "text": "some text #2"
          }
      ],
      "selectAction": {
          "type": "Action.Execute"
      },
      "verticalContentAlignment": "Bottom"
  }

Image

Expected behavior

The moment I remove the selectAction from the example above, I get the expected result

Image

Screenshots

No response

NuGet package version

Windows App SDK 1.7.3: 1.7.250606001

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 24H2 (22621, October 2024 Update)

IDE

Visual Studio 2022

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Adaptive Card template in the issue and reproduce it in the Windows App SDK Widget Board, comparing layout with and without the root selectAction. Trace the card rendering path for verticalContentAlignment and height; done when the specified bottom or stretch alignment is preserved while selectAction is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.