Files
developer-roadmap/src/lib/dom.ts
T
Kamran Ahmed 02e7373bcd feat: add floating chat on roadmap pages (#8765)
* Add floating chat

* Refactor roadmap ai chat to hook

* Chat inside floating chat

* Fix bulk update not working

* Add floating chat widget

* Add chat header buttons

* Show a default set of questions

* Populate chat questions at bottom

* Handle chat submission

* Add personalize popup

* Fix body scroll locking issue

* Add scroll to bottom functionality

* Fix focus issue on persona form

* Fix responsiveness of the floating chat

* Final implementation

* Height fixes

* Fix floating ui

* Upgrade flow in floating chat

* Upgrade responsive UI

* Authetnicated checks

* Responsive bottom bar
2025-06-10 19:43:06 +01:00

22 lines
512 B
TypeScript

export function replaceChildren(parentNode: Element, newChild: Element) {
if (parentNode.replaceChildren) {
return parentNode.replaceChildren(newChild);
}
parentNode.innerHTML = '';
parentNode.append(newChild);
}
export function lockBodyScroll(shouldLock: boolean) {
const isClient = document && 'body' in document;
if (!isClient) {
return;
}
if (shouldLock) {
document.body.classList.add('overflow-hidden');
} else {
document.body.classList.remove('overflow-hidden');
}
}