LiveView possible enhancement question

Hello, so I’ve been working on a side project using phoenix liveview and came across this question

Why don’t DOM binding events behave similarly as handle_event and handle_info methods in the liveview/process?

To elaborate, instead of having attribute bindings for click (phx-click), submit (phx-submit), I feel like it would open up to a lot more flexibility if we implemented something like:

<button phx-on="click:open_modal">Open Modal</button>


Could you attach more than one handler to a single element that way? I don’t think DOM nodes support multiple attributes with the same name.

<button phx-on="click:open_modal" phx-on="focus:focus_button">Open Modal</button>

Ah I so I was thinking it would be in the value instead of continual appending of attributes


<div phx-on="mouseenter:enter_action mouseleave:leave_action"></div>

I felt like something like that would allow the JS portion of the library to be free from keeping in track of so many attributes just for events, and would allow flexibility to any other events (custom events included)