Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown attributes use behavior syntax #1575

Closed
jannisborgers opened this issue Oct 16, 2024 · 1 comment
Closed

Unknown attributes use behavior syntax #1575

jannisborgers opened this issue Oct 16, 2024 · 1 comment
Assignees
Labels
issue Something isn't working correctly

Comments

@jannisborgers
Copy link

What happened?

I thought I had the same issue as #1558 at first, so I’ll add this note here, maybe it’s useful for others, and maybe it should be fixed?

The behavior syntax also applies to unknown attributes. What an unknown attribute is is not clearly stated in the docs. But this:

{{ form.render({
  attributes: {
    "x-data": "form"
  }
}) }}

…when used with multiple instances of the same form, will result in:

<!-- First instance -->
<form x-data="form" >

<!-- Second instance -->
<form x-data="form form" >

The correct way is this:

{{ form.render({
  attributes: {
    "=x-data": "form"
  }
}) }}

Beware the = in front of the attribute name 🫠

Errors and Stack Trace (if available)

No response

How can we reproduce this?

See above

Freeform Edition

Lite

Freeform Version

5.6.5

Craft Version

5.4.8

When did this issue start?

Fresh install of Freeform

Previous Freeform Version

5.6.4

@jannisborgers jannisborgers added the issue Something isn't working correctly label Oct 16, 2024
@jannisborgers jannisborgers changed the title Unknown attributes use adhere to syntax Unknown attributes use behavior syntax Oct 16, 2024
@gustavs-gutmanis
Copy link
Contributor

Hi @jannisborgers

Sorry if the docs aren't clear enough, we will update them to be more clear. This behavior syntax applies to any an all attributes that you pass in the form or field attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue Something isn't working correctly
Development

No branches or pull requests

3 participants