-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
inherit extraVars in x-for scope #357
Conversation
Seems like the proper solution. Thanks for submitting it! |
Hope it will be merged soon |
8e7717a
to
aafd796
Compare
@calebporzio Rebased on #362 👍 |
@rhengles any idea why the tests are now failing? |
@HugoDF It's something to do with the integration server, for some reason it couldn't run any of the tests. From what I can see, it's not something related to the implementation. I'll try a force push and see if the tests run again... |
aafd796
to
f439c35
Compare
@rhengles cool! |
There is a issue with the parent vars when I want to pass them to a x-on:click="Func(parentVar, subVar)" attribute / function. To demonstrate the issue i've made a jsfiddle (using latest commit f439c35) When I click on a checkbox the alert always shows the last subitem.name in the subitems object. <div x-data="GetData()">
<template x-for="item in Object.values(items)">
<div>
<div x-text="item.title"></div>
<input type="checkbox" x-on:click="toggle(item.title. 'test' )" />
<template x-for="subitem in Object.values(item.data.subitems)">
<div>
<label>
<input type="checkbox" x-on:click="toggle(item.title, subitem.name )" />
<span x-text="subitem.name"></span>
</label>
</div>
</template>
</div>
</template>
</div> I hope I have described the problem clearly enough. If not then I would like to hear it so that it can be solved as soon as possible. |
Thanks @SimoTod Co-Authored-By: Simone Todaro <simo.todaro@gmail.com>
@WL1981 I will also add this test to ensure this doesn't happen again. |
Thanks @rhengles ! |
Thanks for this! |
Fixes #356
This has worked for me, but I don't know if it's the proper solution.
Includes tests.
Thanks