microsoft / microsoft/AdaptiveCards

[Rendering] Text wrap with new lines not working in safari

Open
#7,453 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Target Platforms

iOS, Other

SDK Version

1.3

Application Name

Microsoft Teams

Problem Description

Scenario:
Rendered a card with TextBlock containing new lines in the text and maxLines specified in the json.

Issue:
The text wrap is not working correctly for safari and iOS platform.

Screenshots

Safari (Issue):

image

Chrome (Expected):

image
Card JSON
{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.3",
    "body": [
        {
            "speak": "Tom's Pie is a Pizza restaurant which is rated 9.3 by customers.",
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": 2,
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "Redmond, WA",
                            "wrap": true
                        },
                        {
                            "type": "TextBlock",
                            "text": "Malt & Vine",
                            "weight": "Bolder",
                            "size": "ExtraLarge",
                            "spacing": "None",
                            "wrap": true
                        },
                        {
                            "type": "TextBlock",
                            "text": "**Blaire S.** said \"Great concept and a wide selection of beers both on tap and bottled! Smaller wine selection than I wanted, but the variety of beers certainly made up for that. Although I didn't order anything, my boyfriend got a beer and he loved it. Their prices are fair too. \n\nThe concept is really awesome. It's a bar/store that you can bring outside food into. The place was pretty packed tonight. I wish we had stayed for more than one drink. I would have loved to sample everything!\"",
                            "size": "Small",
                            "wrap": true,
                            "maxLines": 3
                        }
                    ]
                },
                {
                    "type": "Column",
                    "width": 1,
                    "items": [
                        {
                            "type": "Image",
                            "url": "https://s3-media1.fl.yelpcdn.com/bphoto/HD_NsxwaCTwKRxvOZs2Shw/ls.jpg",
                            "altText": "image of beer growlers on a table"
                        }
                    ]
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "Action.OpenUrl",
            "subType": "QuickLook",
            "title": "More Info",
            "url": "https://www.yelp.com/biz/malt-and-vine-redmond"
        }
    ]
}
Sample Code Language

No response

Sample Code

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

The issue provides no file, test, or entry point. Reproduce the supplied Card JSON on Safari/iOS and compare the TextBlock wrapping with Chrome, focusing on new lines and maxLines. Done means the text wraps consistently on Safari and iOS without regressing the expected Chrome rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.