Fix to init new Flowbite components to make them work.
New cards' dropdown menus won't work, if the search query is updated.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user