I like to use the Alpine version of Precognition along with “traditional” Blade templates. I’ve noticed that, if I augment a HTML form with the Alpine $form magic, and disable inputs when the form is processing, the inputs’ values aren’t sent to the server.
Doing some digging, it seems the Precognition plugin registers a submit event handler, that sets form.processing to true. When this happens, my <fieldset> elements (and any inputs contained within) are disabled, and therefore their values aren’t sent along with the form submission (I want the form to be submitted server-side rather than asynchronously using the form.submit method from Precognition).
I think the solution to this may be to set form.processing to true on next tick instead. That way, the “native” submission will happen, and the inputs would be disabled immediately after.
Laravel Precognition Plugin Version
0.5.4
Laravel Version
10.48.22
Plugin
Alpine
Description
I like to use the Alpine version of Precognition along with “traditional” Blade templates. I’ve noticed that, if I augment a HTML form with the Alpine
$form
magic, and disable inputs when the form is processing, the inputs’ values aren’t sent to the server.For example:
Doing some digging, it seems the Precognition plugin registers a
submit
event handler, that setsform.processing
totrue
. When this happens, my<fieldset>
elements (and any inputs contained within) are disabled, and therefore their values aren’t sent along with the form submission (I want the form to be submitted server-side rather than asynchronously using theform.submit
method from Precognition).I think the solution to this may be to set
form.processing
totrue
on next tick instead. That way, the “native” submission will happen, and the inputs would be disabled immediately after.Steps To Reproduce
As above.