Skip to content

HTML boolean attributes disables whatever is after on that line #73

Description

@bounav

HTML allows boolean attributes. For example, the HTML code below renders a ticked checkbox.

<input type="checkbox" checked />

In a spark file, the following code always renders the checked attribute, regardless of what the conditional output should should evaluate to:

<input type="checkbox" value="true" readonly checked="checked?{Model.BooleanProperty}" />

Inspecting the HTML show the view renders like this:

<input type="checkbox" value="true" readonly checked="checked?{Model.BooleanProperty}" />

This would indicate that the view engine trips up on the readonly attribute without a value and ignore the rest of the line. Explaining why checked=?{...} renders as is. Making the checkbox aways checked.

Changing the spark file to the code below fixes the problem.

<input type="checkbox" value="true" readonly="readonly" checked="checked?{Model.BooleanProperty}" />

Activity

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

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