[BUGFIX] Fix missing value attribute on radio/checkbox inputs bound to empty string #21109
Merged
NullVoxPopuli merged 1 commit intoemberjs:mainfrom Mar 3, 2026
Merged
[BUGFIX] Fix missing value attribute on radio/checkbox inputs bound to empty string #21109NullVoxPopuli merged 1 commit intoemberjs:mainfrom
NullVoxPopuli merged 1 commit intoemberjs:mainfrom
Conversation
Contributor
Estimated Asset SizesDiff --- main/out.txt 2026-03-03 16:45:40.000000000 +0000
+++ pr/./pr-22633773861/out.txt 2026-03-03 17:02:04.000000000 +0000
@@ -1,7 +1,7 @@
╔═══════╤═══════════╤═══════════╗
║ │ Min │ Gzip ║
╟───────┼───────────┼───────────╢
-║ Total │ 351.99 KB │ 203.84 KB ║
+║ Total │ 351.99 KB │ 203.85 KB ║
╚═══════╧═══════════╧═══════════╝
╔══════════════════════╤═══════════╤═══════════╗
@@ -10,25 +10,25 @@
║ Total │ 313.39 KB │ 181.91 KB ║
╟──────────────────────┼───────────┼───────────╢
║ -internals │ 36.65 KB │ 26.22 KB ║
-║ application │ 13.23 KB │ 8.05 KB ║
+║ application │ 13.23 KB │ 8 KB ║
║ array │ 13.01 KB │ 7.46 KB ║
║ canary-features │ 304 B │ 389 B ║
-║ component │ 2.05 KB │ 1.64 KB ║
+║ component │ 2.05 KB │ 1.65 KB ║
║ controller │ 1.96 KB │ 1.41 KB ║
║ debug │ 11.69 KB │ 8.12 KB ║
║ deprecated-features │ 31 B │ 77 B ║
║ destroyable │ 561 B │ 383 B ║
║ enumerable │ 259 B │ 387 B ║
-║ helper │ 1.08 KB │ 811 B ║
+║ helper │ 1.08 KB │ 813 B ║
║ instrumentation │ 2.43 KB │ 1.79 KB ║
-║ modifier │ 1.22 KB │ 965 B ║
+║ modifier │ 1.22 KB │ 967 B ║
║ object │ 35.94 KB │ 22.16 KB ║
║ owner │ 159 B │ 178 B ║
-║ renderer │ 630 B │ 487 B ║
-║ routing │ 59.3 KB │ 34.12 KB ║
+║ renderer │ 630 B │ 506 B ║
+║ routing │ 59.3 KB │ 34.13 KB ║
║ runloop │ 2.36 KB │ 1.5 KB ║
║ service │ 1 KB │ 845 B ║
-║ template │ 654 B │ 541 B ║
+║ template │ 654 B │ 539 B ║
║ template-compilation │ 429 B │ 366 B ║
║ template-compiler │ 123.08 KB │ 59.45 KB ║
║ template-factory │ 370 B │ 374 B ║
@@ -47,12 +47,12 @@
║ env │ 38 B │ 87 B ║
║ global-context │ 886 B │ 545 B ║
║ manager │ 977 B │ 608 B ║
-║ node │ 175 B │ 260 B ║
+║ node │ 175 B │ 259 B ║
║ opcode-compiler │ 1.11 KB │ 894 B ║
║ owner │ 159 B │ 202 B ║
║ program │ 252 B │ 301 B ║
║ reference │ 548 B │ 531 B ║
-║ runtime │ 10.32 KB │ 5.32 KB ║
+║ runtime │ 10.32 KB │ 5.33 KB ║
║ tracking │ 1.34 KB │ 1.16 KB ║
║ util │ 1.94 KB │ 1.68 KB ║
║ validator │ 15.75 KB │ 6.96 KB ║Details
|
| this.render(`<input type="radio" value={{this.value}}>`, { value: '' }); | ||
|
|
||
| this.assert.strictEqual( | ||
| this.inputElement().getAttribute('value'), |
Contributor
There was a problem hiding this comment.
What did this return before the fix?
Contributor
Author
There was a problem hiding this comment.
- actual: null
- expected: "" (empty string)
- message: "value attribute is present and empty on initial render"
NullVoxPopuli
approved these changes
Feb 21, 2026
NullVoxPopuli
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<input type="radio" value={{""}}>not rendering the value attributeRoot cause
Glimmer applies dynamic attributes (value) before static attributes (type) during element construction. The sequence is:
This was originally reported as Firefox-only but is now reproducible in Chrome 145+.
Fix
When value is explicitly set to '' on an
<input>, also call setAttribute('value', '') in addition to the property setter. This ensures the attribute is present in the DOM regardless of attribute application order. The<textarea>case is excluded since it doesn't use a value attribute.Closes #19219
Cowritten by Claude