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

Context within partials with arguments is acting weird #1931

Open
brdandu opened this issue Mar 31, 2023 · 1 comment
Open

Context within partials with arguments is acting weird #1931

brdandu opened this issue Mar 31, 2023 · 1 comment

Comments

@brdandu
Copy link

brdandu commented Mar 31, 2023

{{#block_helper1}}
{{#block_helper2}}
{{#if true}}
{{#*inline "newInlineTest" argumentKey="argumentValue"}}{{../block_helper_1_attribute}}{{/inline}}
{{>newInlineTest}}
{{/if}}
{{/block_helper2}}
{{/block_helper2}}

For the above use case newInlineTest partial fetches the result from block_helper2 instead of block_helper1.
However if I change the inline to {{#*inline "newInlineTest"}}{{parent.block_helper_1_attribute}}{{/inline}} then it fetches the result from block_helper1 like it is expected to.
Seems like ../ and parent. are not behaving the same way for partials with arguments

@bzbarsky-apple
Copy link

And in particular, removing the {{#if true}} bit makes ../block_helper_1_attribute actually get a result from block_helper1. So the if is affecting scoping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants