Using Select2 with Phoenix LiveView
Using Select2 with Phoenix LiveView
LiveView doesn’t support JavaScript interop at the moment (but it’s a planned feature), so in this article we see how to come up with a workaround to make LiveView playing together with a JavaScript library like Select2.
We see how to take advantage of phx:update
events, which LiveView dispatches every time it updates the DOM. Then, we see how to send events to the server using liveSocket
.
Read next ElixirMix Podcast 060 - Property-Based Testing, Dialyzer, & Inaka with Brujo Benavides