-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
@click is not a valid attribute name #396
Comments
It's the norm in javascript, you would get the same error with any framework if you try to set an attribute containing the character '@' via code using setAttribute. |
i had the same problem with wordpress and using both acf blocks with JSX for and alpine. :class="'hidden' == navScroll" x-data="initNav" Where initNav refers to an external javascript file with the alpine logic you need |
If you're working with JSX. The errors seem to come from the JSX parser. We can trick it by using spread object props. <div x-data="{ isEditing: false }">
<textarea
class="textarea w-full textarea-ghost font-normal"
{...({"@keyup.esc": "isEditing = false"})}
></textarea>
</div> |
I would like to use Alpine.js in a Phoenix LiveView application for some very simple interactions like toggling a dropdown.
However in phoenix_live_view.js a
setAttr()
call is crashing because'@click' is not a valid attribute name.
How to reproduce
The text was updated successfully, but these errors were encountered: