Fix to init new Flowbite components to make them work.

New cards' dropdown menus won't work, if the search query is updated.
dev
KKlochko 2 months ago
parent 8999897685
commit 96a6c34895

@ -47,3 +47,14 @@ liveSocket.connect()
// >> liveSocket.disableLatencySim()
window.liveSocket = liveSocket
// to init new Flowbite components if a page updated by navigation
window.addEventListener("phx:navigate", () => {
const delay = 100;
setTimeout(() => {
window.dispatchEvent(
new Event("phx:page-loading-stop", { bubbles: true, cancelable: true })
);
}, delay);
});

Loading…
Cancel
Save