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

[5.x] Revert requirement of prefixing attributes with :attr #9854

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Apr 10, 2024

This PR essentially reverts #9576.


We've changed the character from @ to \ in #9856 so that it's not a breaking change anymore. The change below is not needed.


Now, the only thing you'll need to change is that if you have a parameter that starts with @. Since #8887, prefixing a parameter with @ will prevent parsing. You can get around this by prefixing with attr:, or using Vue/Alpine's alternate syntaxes:

{{ form:create
    in="contact"
-   @click="submitForm"
+   attr:@click="submitForm"
+   (or x-bind:click="submitForm")
}}

However! We're planning to change the syntax of #8887 so you won't even need to do that. Done!

@robdekort
Copy link
Contributor

Neat. alt please :-)

@marcorieser
Copy link
Contributor

preserveAspectRatio please

@dave-smyth
Copy link

loading please :)

@jeremyvienney
Copy link

styleattribute too please :)

@JonKaric
Copy link
Contributor

Gonna end up with quite a few attributes on this list. I like not having to do attr: most of the time, but then it feels weird to have to type attr: for some and not for others and could confusing for someone just hopping into Statamic

{{ svg src="check" class="w-5 h-5 mr-2 fill-black" data-example="bacon" attr:x-show="selected.id == $id('select-option')" aria-hidden="true" }}

@jasonvarga
Copy link
Member Author

jasonvarga commented Apr 10, 2024

Yeah still a bit derpy. Probably gonna revert to the old behavior. 👍

@jasonvarga jasonvarga changed the title [5.x] Allow certain parameters to be rendered as html attributes without attr: prefix [5.x] Revert requirement of prefixing attributes with :attr Apr 10, 2024
@jasonvarga jasonvarga merged commit 9e504cc into master Apr 10, 2024
33 checks passed
@jasonvarga jasonvarga deleted the render-attribute-allowable-params branch April 10, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants