[HTML] Add isPrimary boolean property to the Action class
See original GitHub issueProblem
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:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we can do that. I just opened https://github.com/Microsoft/AdaptiveCards/issues/1517
Implemented solution in #1521