Skip to content

fix column layout issue #7477

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

Closed
wants to merge 0 commits into from
Closed

fix column layout issue #7477

wants to merge 0 commits into from

Conversation

feiyin0719
Copy link

@feiyin0719 feiyin0719 commented May 24, 2022

Related Issue

Fix [#7476 ]

Description

Fix column layout issue, the column flex is set error
For px, we only need to set width and height
For weight, we set flex
For auto, we should set flex to 0, and not set size, it will calculate the size with children
For stretch, we set flex to 1
And we should set the flexShrink to point up which element need to scale

Precedence order of displaying elements with the width attribute
px > weight > auto > stretch

Sample Card

{
    "type": "AdaptiveCard",
    "version": "1.3",
    "body": [
        {
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": "auto",
                    "items": [
                        {
                            "type": "Image",
                            "url": "https://searchuxcdn.azureedge.net/designerapp/images/servicenow-icon.png",
                            "size": "Small",
                            "horizontalAlignment": "Center",
                            "altText": "Not available"
                        }
                    ],
                    "height": "stretch"
                },
                {
                    "type": "Column",
                    "width": 8,
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "[KB0033192 OneITVSO: Create Repos In a Test Instance and Provide Force Push Access](https://microsoft.service-now.com/kb_view.do?sys_kb_id=713adb5d131fd6003976bc42f244b0f2)",
                            "color": "Accent",
                            "size": "Medium",
                            "weight": "Bolder"
                        },
                        {
                            "type": "TextBlock",
                            "text": "Last modified {{DATE(2022-03-21T14:02:23Z,SHORT)}}",
                            "spacing": "None"
                        },
                        {
                            "type": "TextBlock",
                            "text": " 1. You can create repositories through the web application 2. For links to both Prod and Staging, ...",
                            "wrap": true,
                            "maxLines": 3,
                            "spacing": "Small",
                            "color": "Dark"
                        }
                    ],
                    "horizontalAlignment": "Center",
                    "spacing": "Medium"
                }
            ]
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}

If appropriate, please include a link to a card in one of the samples directories that can be used to validate this change. This can be an existing card or a card added with this PR.

How Verified

  1. open ReactNative Column.Auto
Microsoft Reviewers: Open in CodeFlow

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

Successfully merging this pull request may close these issues.

1 participant