-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
Django 5.2
Python 3.13
Django-cotton 2.1.1
Inner component:
<c-vars :action="request.path"
method="post"
class="space-y-3"
/>
<form class="{{ class }}"
action="{{ action }}"
method="{{ method }}"
{{ attrs }}>
{% csrf_token %}
{{ slot }}
</form>
Outer component:
<c-vars
:hx-post="request.path"
hx-target="this"
hx-swap="outerHTML"
/>
<c-form :hx-post=action
:hx-target=hx_target
:hx-swap=hx_swap
:action=hx_post
:attrs="attrs">
{{ slot }}
</c-form>
Calling the component:
<c-form.hx-form id="preferences-form" hx-post="/prefs">
.....content here
</c-form.hx-form>
Rendered result:
<form class="space-y-3"
action="/prefs"
method="post"
hx-target="this"
hx-swap="outerHTML"
action="/prefs"
id="preferences-form"
hx-post="/prefs">
The action
attribute is rendered twice: attributes should be just rendered once.
Metadata
Metadata
Assignees
Labels
No labels