I am using LiveView to render a form and a
phx_change event to send updates back to the controller. I’m also using an extra library (Select2: https://select2.org/) as a more robust
phx_change event back to the LiveView.
I’ve inspected the change event payload and noted it’s like any other event and just contains an encoded chunk of the full form data, so I can replicate that behavior in my own code if need be, but ideally I’d like a LiveView JS-interop way to do this programmatically. Something either like
this.pushFormChange() or finding the form instance and making a
trigger call on the event that the JS interop has bound to, but so far I’ve been unable to find anything either in the documentation, in the source code, or in some trial-and-error that works the way I want.
Is this something that’s possible or that anybody has done? Alternatively, is my approach simply wrong here?