chat-uigl / src /lib /utils /deepestChild.ts
DakMak's picture
Duplicate from coyotte508/chat-ui
ece0c29
raw
history blame contribute delete
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;
}