Astro v4.16.7
Node v20.11.1
System Linux (x64)
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/tailwind
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Basically same as #12023 but for the checked attribute for radio and checkbox inputs. When setting the checked attribute dynamically, checked={true} outputs checked="true" but when its false, it doesn't output anything.
What's the expected result?
This does seem like correct behavior at first glance but the truthy condition should return checked only instead of assigning string values that are considered invalid, as per the html spec. I've added some examples to show that any string value causes checked to be enabled.
Btw, the commit 1d18bb3 that's linked above shows a warning because I first made the change on a patch branch, then deleted it because I realized it needed to be on main. The correct commit is part of the PR.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Basically same as #12023 but for the
checked
attribute for radio and checkbox inputs. When setting the checked attribute dynamically,checked={true}
outputschecked="true"
but when its false, it doesn't output anything.What's the expected result?
This does seem like correct behavior at first glance but the truthy condition should return
checked
only instead of assigning string values that are considered invalid, as per the html spec. I've added some examples to show that any string value causeschecked
to be enabled.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-xghd9q?file=src%2Fpages%2Findex.astro
Participation