Closed luigi-discoup closed 10 months ago
It turns out that it's not a Petal issue but a Phoenix LiveView-AlpineJS integration one. I found the solution in the official doc of Phoenix LiveView.
To add support to AlpineJS, it's enough to use these options:
let liveSocket = new LiveSocket("/live", Socket, {
...,
dom: {
onBeforeElUpdated(from, to){
if(from._x_dataStack){ window.Alpine.clone(from, to) }
}
},
})
However, this should probably be added to the Petal's documentation as well.
Oh yes thanks - we'll add it in
it helped. Thank you
In the root layout of my project, I've incorporated the Petal's dropdown menu using the following code:
then I render a live view in that root layout.
However, I've encountered an issue. Every time I click on a button or link associated with an action, it unexpectedly triggers the dropdown open event.
For instance, within my live view, I have this code:
Clicking the
New platform
also triggers the dropdown menu to open.Interestingly, if I utilize
js_lib="live_view_js"
, everything seems to work as intended.