Skip to content

Bad logic in example #103

@brooks-child

Description

@brooks-child

<tr th:class="${row.even}? (${row.first}? 'first' : 'even') : 'odd'">

The first row checking ternary needs to be on the odd half of the even checking ternary rather than the even.

1 is odd so row.even will evaluate to false and then be set to "odd".

There is no way for the "first" to ever be returned.

Proposed refactor:
<tr th:class="${row.first}? 'first' : (${row.even} ? 'even' : 'odd')">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions