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

[Glimmer] {{each}} with itemViewClass = broken tagName & {{else}} #11164

Closed
owain opened this issue May 14, 2015 · 2 comments · Fixed by #11231
Closed

[Glimmer] {{each}} with itemViewClass = broken tagName & {{else}} #11164

owain opened this issue May 14, 2015 · 2 comments · Fixed by #11231
Labels
Milestone

Comments

@owain
Copy link

owain commented May 14, 2015

When using itemViewClass with {{each}} in Ember 1.13-beta.1, the item view's tagName is not used and is always rendered with a div.

<ul>
      {{#each model itemViewClass="listItem" as |item|}}
        <h4>{{item}}</h4>
      {{/each}}
</ul>
App.ListItemView = Em.View.extend({
  tagName: 'li'
});

The above code should:

<ul>
  <li><h4>item #1</h4><li>
</ul>

But actually renders:

<ul>
  <div><h4>item #1</h4><div>
</ul>

When an {{else}} is used with and {{each model itemViewClass ...}}, the template is not rendered when model is falsey. It works fine when there is no itemViewClass

<ul>
      {{#each model itemViewClass="listItem" as |item|}}
        <h4>{{item}}</h4>
      {{else}}
        <h4>No Data</h4>
      {{/each}}
</ul>

Both issues are illustrated in this JSBin: http://emberjs.jsbin.com/xumihahiwa/1/edit

There's also seems to be an issue thrown with the toggle action I added in there to set the model data on the controller to illustrate the {{else}} issue.

Here's it functioning fine with Ember 1.12: http://emberjs.jsbin.com/fepavokome/1/edit

@rwjblue
Copy link
Member

rwjblue commented May 14, 2015

Thanks for the detailed bug report. I'll try to investigate tonight, and see exactly what is going on...

@rwjblue
Copy link
Member

rwjblue commented May 20, 2015

#11228 addresses the tagName + itemViewClass issue, still looking into the {{else}} one...

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

Successfully merging a pull request may close this issue.

2 participants