fix code demo with empty slot

This commit is contained in:
konnorrogers
2024-12-19 14:04:13 -05:00
parent 995d0f2af4
commit cf75b7ac25

View File

@@ -77,6 +77,11 @@ export default class WaCodeDemo extends WebAwesomeElement {
private readonly hasSlotController = new HasSlotController(this, 'preview');
firstUpdated () {
// This works around a bug where if you have no slotted preview, initial previews will not load.
this.requestUpdate()
}
render() {
// NOTE We don't want to render the contents of the code element anywhere if a custom preview is provided.
// That way, providing a custom preview can also be used to sanitize the code.