Skip to content

Use checkbox default value 'on' in LiveViewTest#3886

Merged
SteffenDE merged 1 commit intophoenixframework:mainfrom
ftes:feature/checkbox-default-value-on
Jul 11, 2025
Merged

Use checkbox default value 'on' in LiveViewTest#3886
SteffenDE merged 1 commit intophoenixframework:mainfrom
ftes:feature/checkbox-default-value-on

Conversation

@ftes
Copy link
Contributor

@ftes ftes commented Jul 8, 2025

As per the HTML spec, inputs with type checkbox have a default value of on.

On getting, if the element has a value content attribute, return that attribute's value; otherwise, return the string "on".
https://html.spec.whatwg.org/multipage/input.html#checkbox-state-(type=checkbox)

This PR allows |> form("#form", checkbox_no_value: "on"), which previously resulted in an error.

@SteffenDE SteffenDE merged commit 4cecfad into phoenixframework:main Jul 11, 2025
6 of 7 checks passed
@SteffenDE
Copy link
Collaborator

🙌🏻

SteffenDE pushed a commit that referenced this pull request Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments