Closed andjsch closed 3 months ago
So you have x-show="!success"
on your form to make it disappear? From a UX and a11y POV I don't think it's a good idea to hide the form. I don't have anything right now to back this up, but it feels wrong.
Correct. I only focus on the success message. But thanks for making me aware, I am checking this with an accessibility expert.
As mentioned, it's not a bummer to not make this change. One could always publish the form_handler
. I am coming from this very specific use-case. Anyhow, but what if one wants to change the timeout to let`s say 7 seconds instead of the 4.5? You'd still need to publish the form_handler
which feels overkill to me.
Gotcha. I'm not opposed to it.
Is your feature request related to a problem? Please describe. A customer requested for forms to not reappear after a successful submission. Easy. Publish the form handler and remove the
setTimeout
-part. Done.Describe the solution you'd like But what if we thought of the
setTimeout()
as the "default success hook"? We could put thesetTimeout()
into thesuccessHook()
method, which would still allow for additions, but also allow for it to be skipped by simply adding areturn
.How it currently works:
How it could work:
Describe alternatives you've considered The {{ success_hook }} could probably be placed within the
then()
method, but the current state is cleaner.