On submission of a form bound with a phx-submit event:
The form’s inputs are set to readonly
Any submit button on the form is disabled
The form receives the "phx-submit-loading" class
My suspicion is that for this to work, you need to add type="submit" on the button, have you tried that?
Update: Actually, I cannot reproduce the behavior from your example as it is, the button is always disabled until the response arrives. (Phoenix 1.7.2 with LV 0.18.18). Are you returning immediately in handle_event("search", ...) and pushing the search results at a later time, per chance? Otherwise I can’t really understand the behavior you’re seeing without more context.
Ah also: If your example is indeed all there is to it at the moment, then it’s very likely the case that the roundtrip is just that quick locally, meaning the button is already re-enabled when you’re hitting the mouse the second time when double-clicking. Try adding Process.sleep(3000) in handle_event to verify.