Skip to content

Compilers inline ?? "" for a nullish checkbox/radio value in non-hydratable builds (follow-up to #4009) #4017

Closed

Description

@ryansolid

Summary

#4009 (closing #4008) fixed the runtime: when a checkbox or radio gets a nullish value, setProperty and the spread path now remove the attribute, so a checked box submits the native "on" instead of "".

Non-hydratable client builds don't reach that path for a direct binding. Both compilers inline the #2957 text-field fallback for value/defaultValue on every input, whatever its type:

  • @solidjs/babel-plugin: packages/babel-plugin/src/dom/element.ts L458, t.logicalExpression("??", value, t.stringLiteral("")).
  • @solidjs/compiler: the equivalent in packages/compiler/src/dom/set_attr.rs (around L163).

So in a client-only build this still submits "" when v() is nullish:

<input type="checkbox" name="agree" value={v()} checked />

Expected

The build modes should behave the same. When the input's static type is checkbox or radio, or isn't static, a nullish value/defaultValue should remove the attribute, as the runtime does. Text inputs and textarea keep the ?? "" clearing from #2957.

Notes

— Claude via Claude Code


Generated by Claude Code

Activity

  1. ryansolid commented on Oct 13, 2026

    @ryansolid
    MemberAuthor

    Fixed by #4021 (merged into next): in non-hydratable builds, a nullish checkbox/radio value now removes the attribute instead of inlining ?? "", in both compilers.

    — Claude via Claude Code


    Generated by Claude Code

  2. ryansolid commented on Oct 13, 2026

    @ryansolid
    MemberAuthor

    Fixed by #4021, now merged into next.

    — Claude via Claude Code


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions