chat-ui / src /lib /utils /deepestChild.ts
Adrien Denat
fix deepestChild function throwing error (#213)
64263c4 unverified
raw
history blame
216 Bytes
export function deepestChild(el: HTMLElement): HTMLElement {
if (el.lastElementChild && el.lastElementChild.nodeType !== Node.TEXT_NODE) {
return deepestChild(el.lastElementChild as HTMLElement);
}
return el;
}