Greetings!
For my question I have spun up a demo backed by a github repo to explain what I am facing.
The demo is a simple web app with a sidebar containing links to two pages. The pages are live views. I have used flowbite js lib to implement a sidebar with dropdown for the links. The sidebar is defined in app.html.heex so I can verify current_user (not relevant here but needed in the full project I am working on).
The tricky part: upon loading a webpage, flowbite needs to do some shenanigans with binding buttons to their element counterparts to actually control elements (by data-drawer-target etc, this is somewhat irrelevant). So I have used <.link navigate={...}> as described in LiveView docs assuming, as it says, that
They mount a new LiveView while keeping the current layout
But I have encountered that these links seem to regenerate whole layout upon clicking, thus breaking flowbyte’s bindings. You can see that by opening the drawer and clicking the link for some of the pages. Upon loading the page, you won’t be able to open the drawer until you call initDrawers() in the dev console. Same goes with dropdowns.
I have even tried to use phx-target to directly target the events to the pages’ liveviews (hence the liveview-cont class on pages’ elements). But this hasn’t changed anything.
So my question is: how does this functionality exactly have to work? I assumed that page1 and page2 are the liveviews inside my app layout that I can recreate independently.
Is there a working case on this? Please help, I am quite out of ideas ![]()
My env is as follows:
elixir 1.15.7-otp-26
erlang 26.1.2
phoenix 1.7.10
phoenix_live_view 0.19.5






















