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

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

Open
bounav opened this issue Feb 2, 2023 · 0 comments
Open

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

bounav opened this issue Feb 2, 2023 · 0 comments
Labels

Comments

@bounav
Copy link
Collaborator

bounav commented Feb 2, 2023

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}" />
@bounav bounav changed the title HTML boolean attributes disable whatever is after on that line HTML boolean attributes disables whatever is after on that line Feb 2, 2023
@bounav bounav added the Bug label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant