question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[UWP][Textblock] Long string doesn't wrap

See original GitHub issue

Platform

UWP

What platform is your issue or question related to? (Delete other platforms).

  • UWP

Author or host

Host

Are you an author (like sending something to Outlook), or a host that is rendering your own cards? If host, please specify the corresponding host (app) name. Cortana on Windows

What version are you using? Ex: NuGet 1.0.2, or latest main, etc… 1.2.7

Details

We have long strings in an AC textblock, when we specify for them to wrap they don’t wrap unless the string has spaces image

We are also seeing a strange wrap if there is a + character- this causes the wrap to happen wherever the + character is in the string which could be early on: image

This is not an issue for the web renderer, only seems to happen on UWP.

Here is the JSON for this issue:

{
  "type": "AdaptiveCard",
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.2",
  "body": [
    {
      "type": "TextBlock",
      "text": "ThisIsAReallyLongTextBlockWithNoSpaces",
      "size": "ExtraLarge",
      "wrap": true,
      "maxLines": 2
    }
  ]
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
RebeccaAnnecommented, Sep 9, 2020

Confirmed that the main wrapping bug repros in 1.2.7 but not 2.1.0. Looks like this got fixed somewhere along the way. Investigating the + behavior.

0reactions
RebeccaAnnecommented, Sep 22, 2020

The main issue where long words were not wrapping is fixed in the latest version. The breaking on + is the behavior of the UWP TextBlock control, and is not configurable. Although this may not be consistent with Adaptive Cards behavior on other platforms (JavaScript doesn’t do this, for example), it is consistent with text block behavior in UWP generally. Closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextBlock TextWrapping not wrapping - wpf
Because there's nothing to constrain the width of the TextBlock, it doesn't wrap. If you switch to Vertical orientation then the wrapping works, ......
Read more >
TextWrapping Enum (Windows.UI.Xaml) - UWP
Specifies whether text wraps when it reaches the edge of its container. ... the long word and continue the text after the long...
Read more >
The TextBlock control
The blue TextBlock uses the TextWrapping property with the value Wrap, to make the TextBlock wrap to the next line whenever it can't...
Read more >
RowDetailsTemplate and Text Wrapping in UI for WPF
The problem that I'm having is that if the text is particularly long in the row details view, it won't wrap automatically.
Read more >
TextWrapping - 2000 Things You Should Know About WPF
By default, the text displayed in a TextBox does not wrap to multiple lines–even if the TextBox is tall enough to accommodate several...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found