autocomplete
autocomplete copied to clipboard
My custom container deleted
detach()
removes my custom container from parent. But attach()
add it to <body>
instead of parent
function detach(): void {
const parent = container.parentNode;
if (parent) {
parent.removeChild(container);
}
}
function attach(): void {
if (!container.parentNode) {
doc.body.appendChild(container); // append to parent if it exists
}
}