Duplicated from huggingchat/chat-ui
3aa8136
1
2
3
4
5
6
7
8
export function deepestChild(el: HTMLElement) { let newEl = el; while (newEl.hasChildNodes()) { newEl = newEl.lastElementChild as HTMLElement; } return newEl; }