Skip to content

Objects with a length property of 0 evaluate to false in handlebars conditionals #12738

@kevinkucharczyk

Description

@kevinkucharczyk

When using the if template conditional on objects that have a length property equal to 0 the conditonal evalutes to false and will not render what was expected.

Here's a twiddle with an example: https://ember-twiddle.com/7434ede64e1ed3888b2d

An object with length greater than 0 will evaluate to true and render properly.

I believe such objects might be treated as arrays, leading to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions