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

Cast x-spread expression to string #958

Merged
merged 5 commits into from Jan 4, 2021
Merged

Cast x-spread expression to string #958

merged 5 commits into from Jan 4, 2021

Conversation

KevinBatdorf
Copy link
Contributor

This breaks because expressions are functions in x-spread, and when the output is defined, it attempts to run a String operation on it.

 if (output === undefined && expression.match(/\./)) {
     output = ''
 }

...which causes an error. This fix will just cast the function there to a string so it won't error out.

Fixes #957

@KevinBatdorf
Copy link
Contributor Author

Also snuck a little note on x-ref but can remove that if you want

@calebporzio
Copy link
Collaborator

Thanks Kevin!

@calebporzio calebporzio merged commit 0e2ed20 into alpinejs:master Jan 4, 2021
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.

Using x-text inside x-spread doesn't work. Throws error!
2 participants