[Designer] How can I change the default card payload?
See original GitHub issueI’m trying to use the Card Designer JS SDK in a product I’m working on, and I would like to change the default card payload that the designer is initialized with so that it is a blank card, instead of the “Publish Adaptive Card Schema” card.
I can’t set my own stored card payload with designer.setCard() until the Monaco Editor component gets initialized - require(['vs/editor/editor.main'], function () { designer.monacoModuleLoaded(); designer.setCard(card)}):
- , so for half a second after the designer is attached it will show the default card from constants.ts.
This might be a little unusual because I am using OrchardCore, and so I’m pulling in their packaged version of Monaco, but going through the OrchardCore source it should be the same version.
I suppose I can wrap everything in a div and hide it until everything is initialized, but I would rather not do that.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Sounds like this has been resolved. Please let us know if this doesn’t work for you. Thanks!
@ericrrichards we don’t have API for you to change the default payload from code. I moved
designer.attachTo(document.getElementById("designerRootHost"));
into the require function, likely it avoids the problem in my testing.Otherwise please try what @fabiofranzini mentioned, and it should work too.