Return '' for slots that are null or not loaded

pull/200/head
Cory LaViska 2020-09-02 17:23:33 -04:00
rodzic 2aa0f83e6a
commit 6529200dda
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -24,7 +24,7 @@ export function getInnerHTML(slot: HTMLSlotElement): string {
// string. This is useful because we can't use slot.textContent as an alternative.
//
export function getTextContent(slot: HTMLSlotElement): string {
const nodes = slot.assignedNodes({ flatten: true });
const nodes = slot ? slot.assignedNodes({ flatten: true }) : [];
let text = '';
[...nodes].map(node => {