Skip to content
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

[Rendering] TextRun with selectAction OpenUrlAction inside RichTextBlock #8637

Open
tomflenner opened this issue Aug 2, 2023 · 0 comments
Open

Comments

@tomflenner
Copy link

Target Platforms

NodeJS

SDK Version

1.3.2

Application Name

Microsoft Teams

Problem Description

Hello,

I am trying to render a card which contains a RichTextBlock with two TextRun with the JavaScript SDK :

  1. Is a simple text TextRun
  2. Is a clickable TextRunwith OpenUrlAction as selectAction

Everything is fine while creating my RichTextBlock : when I watch the .toJSON() result I can see my selectAction.

After using AdaptiveCards.addItem and watch the .toJSON() of my AdaptiveCards I don't see the selectAction anymore.

Microsoft Teams is rendering my card but there is not OpenUrlAction on the second TextRun.

It seems like the method .addItem remove selectAction from my TextRun.

Maybe I am not using well the JavaScript SDK ?

Screenshots

RichTextBlock content before .addItem :
image

Card after adding RichTextBlock with .addItem
image

Card JSON

Not needed, the card is rendered.

Sample Code Language

TypeScript

Sample Code

const card = new AdaptiveCard();
const richTextBlock = new RichTextBlock();

const textRun1 = new TextRun('first text sample');
textRun1.weight = TextWeight.Bolder;

const textRun2 = new TextRun('second url text sample');
textRun2.weight = TextWeight.Bolder;
textRun2.color = TextColor.Accent;

const openUrlAction = new OpenUrlAction();
openUrlAction.url = "http://sampleurl.com";
textRun2.selectAction = openUrlAction;

richTextBlock.addInline(textRun1);
richTextBlock.addInline(textRun2);

card.addItem(richTextBlock);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant