File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ export const AdaptiveCardDesigner = (props: IAdaptiveCardDesignerHostProps): JSX
186
186
props . context ) ;
187
187
188
188
convertNullToEmptyString ( dataObject ) ;
189
+ cardDesigner . sampleData = dataObject ?. $root || { } ;
189
190
cardDesigner . dataStructure = FieldDefinition . deriveFrom ( dataObject . $root ) ;
190
191
} , [ isMonacoLoaded ,
191
192
props . addDefaultAdaptiveCardHostContainer ,
Original file line number Diff line number Diff line change @@ -153,12 +153,11 @@ export const AdaptiveCardHost = (props: IAdaptiveCardHostProps): JSX.Element =>
153
153
currentAdaptiveCard . parse ( cardPayload , serializationContextInstanceRef . current ) ;
154
154
155
155
const renderedElement = currentAdaptiveCard . render ( ) ;
156
- currentRenderElement . innerHTML = "" ;
157
- currentRenderElement . appendChild ( renderedElement ) ;
158
-
159
- // just for debugging pourpouse
160
- console . log ( evaluationContext ) ;
161
- // *****
156
+ // If this isn't acceptable, we should compare the old template with the new template
157
+ if ( renderedElement . outerHTML !== currentRenderElement . innerHTML ) {
158
+ currentRenderElement . innerHTML = "" ;
159
+ currentRenderElement . appendChild ( renderedElement ) ;
160
+ }
162
161
} catch ( cardRenderError ) {
163
162
if ( props . onError ) {
164
163
props . onError ( cardRenderError ) ;
You can’t perform that action at this time.
0 commit comments