You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Remove discrepancy between formAssociated bool resolving and normal bool Props #6906
I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
There is a discrepancy between resolving formAssociated bool properties vs normal bool properties.
formAssociated bool properties are resolved like this:
disabled="" // true
disabled="true" // true
disabled="false" // true
// false
while normal bool properties are resolved like this:
disabeld="" // true
disabled="true" // true
disabled="false" // false <=========== !!!
// false
There should be an stencil.config option where we can force other bool properties to behave like formAssociated bool properties
Describe the Use Case
There should be a consistency on how Properties of the same type are resolved independent on whether they are formAssociated properties or not
Describe Preferred Solution
The preferred solution would be to unify the behavior consistently.
Add a stencil.config option { resolveBoolAttributes: "native" | "falseEqualsFalse" } (I'm bad at naming types :D) which has the current behavior as default and for future major versions is changed to the native behavior
Describe Alternatives
Add a stencil.config option and keep the current default behavior
OR formAssociated bool props should be resolved like other bool props in Stencil
Related Code
I also added a bug, because the current behavior for formAssociated bool props is broken: #6905
Hit the same inconsistency from the other side, and the native rule settles which direction unification should go. Verified in Chromium just now:
setAttribute('disabled', '') → disabled === true
setAttribute('disabled', 'false') → disabled === true (presence wins, value ignored)
setAttribute('disabled', '0') → true
absent → false
So the browser has exactly one rule — presence — with no string sniffing at all. The disabled="false" → false behavior of normal Stencil bool props matches no browser; it's a DX invention (a popular one — I use @dooboostore/simple-web-component, which does the same 'false'/'0' → false carve-out and documents it as a deliberate deviation from native).
For the proposed resolveBoolAttributes option, that gives a clean definition of "native": presence-only, i.e. today's formAssociated behavior extended everywhere. And it makes "falseEqualsFalse" honestly named as the legacy DX mode rather than the default-looking one. One test worth pinning either way: disabled="" must read true under both modes (that's the case #6963 tripped on — empty string collapsing into the false default), so the two modes differ only on the literal 'false'/'0' strings, never on presence itself.
Activity
johnjenkins commentedon Sep 24, 2026
hey @FabioGimmillaro thanks for raising - yes I know Stencil is weird around bool and string false. Thanks for reminding me I did plan to remove the behaviour in v5 :)
visualkhh commentedon Nov 1, 2026
Hit the same inconsistency from the other side, and the native rule settles which direction unification should go. Verified in Chromium just now:
setAttribute('disabled', '')→disabled === truesetAttribute('disabled', 'false')→disabled === true(presence wins, value ignored)setAttribute('disabled', '0')→truefalseSo the browser has exactly one rule — presence — with no string sniffing at all. The
disabled="false" → falsebehavior of normal Stencil bool props matches no browser; it's a DX invention (a popular one — I use @dooboostore/simple-web-component, which does the same'false'/'0'→ false carve-out and documents it as a deliberate deviation from native).For the proposed
resolveBoolAttributesoption, that gives a clean definition of"native": presence-only, i.e. today's formAssociated behavior extended everywhere. And it makes"falseEqualsFalse"honestly named as the legacy DX mode rather than the default-looking one. One test worth pinning either way:disabled=""must readtrueunder both modes (that's the case #6963 tripped on — empty string collapsing into thefalsedefault), so the two modes differ only on the literal'false'/'0'strings, never on presence itself.