feat: guard to prevent premature form submissions while uploading
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' } }) }}
|
||||
{% set formAttr = stimulus_controller('form-upload-guard')|stimulus_action('form-upload-guard', 'guard', 'submit') %}
|
||||
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' }|merge(formAttr.toArray()) }) }}
|
||||
<div class="flex flex-col space-y-4 pb-4">
|
||||
{{ form_row(form.category) }}
|
||||
{{ form_row(form.name) }}
|
||||
@@ -18,7 +19,7 @@
|
||||
{{ form_errors(form) }}
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
<button type="submit" class="btn" {{ stimulus_target('form-upload-guard', 'submit') }}>
|
||||
speichern
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
|
||||
Reference in New Issue
Block a user