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.

[HTML] Add isPrimary boolean property to the Action class

See original GitHub issue

Problem

For backwards compatibility with its previous Actionable Message card format, Outlook needs the ability to mark an action as “primary” so that it can get a different visual treatment.

Solution

In the HTML renderer:

  • Introduce an isPrimary boolean property on the Action class
  • Introduce a way to custom parse Action objects (similarly to the custom parsing of Element objects)

Design

New isPrimary property on the Action class:

export class Action {
    ...
    isPrimary: boolean = false;
    ...
}

Custom action parsing events (global and per-card, like other events):

export class AdaptiveCard {
    ...
    static onParseAction: (action: Action, json: any) => void = null;
    onParseAction: (action: Action, json: any) => void = null;
    ...
}

It is the responsibility of the host to handle the onParseAction event to custom parse the isPrimary action. isPrimary is not parsed out of the box and is not an official Adaptive property.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dclauxcommented, May 26, 2018

Yes, we can do that. I just opened https://github.com/Microsoft/AdaptiveCards/issues/1517

0reactions
dptejascommented, Jun 2, 2018

Implemented solution in #1521

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add boolean attribute using JavaScript - html
To add a Boolean attribute: node.setAttribute(attributeName, ''); // example: document.body.setAttribute('hidden', '');.
Read more >
Pointer Events
In a multi-pointer (e.g. multi-touch) scenario, the isPrimary property is used to identify a master pointer amongst the set of active pointers ...
Read more >
Pointer Events
Initializes the pointerType property of the PointerEvent object. isPrimary of type boolean, defaulting to false: Initializes the isPrimary ...
Read more >
ButtonBase
Indicates that the button should be a HTML reset button. boolean, isVisible() Use the visible attribute to indicate whether the component should be...
Read more >
Pointer Events
Authors can prevent the firing of certain compatibility mouse events by canceling the pointerdown event (if the isPrimary property is true ).
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