Skip to content

fix(web): preserve selections after a spread removes checked - #5268

Open
Marve10s wants to merge 1 commit into
solidjs:mainfrom
Marve10s:fix-web-release-removed-spread-binding
Open

Marve10s wants to merge 1 commit into
solidjs:mainfrom
Marve10s:fix-web-release-removed-spread-binding

Conversation

@Marve10s

Copy link
Copy Markdown
Contributor

Summary

After a reactive JSX spread removes checked, a later unrelated prop update can clear a checkbox or radio the user has selected again. The first omission writes the cleared value and caches it, so subsequent omissions keep reapplying it.

Remember that the binding was removed and stop writing to it while it is absent. Keep the last written value for comparison if the binding returns during a held update.

How did you test this change?

The new regressions cover click and reset on checkboxes and radios, including form submission and reintroducing the binding. A held-update regression checks the form entry when the spread reintroduces checked: undefined before the pending result settles. The focused tests pass with both the native and Babel compilers. The root build passed 30 tasks, the root test and typecheck run passed 39 tasks, and all 22 bundle-size scenarios passed.

Verification

On published @solidjs/web 2.0.4, an unrelated title change cleared a selection restored after the spread lost the checked key. In Chromium, clean main submitted "primary" immediately after that click or reset and no value after the title change. With the patch, both compilers still submitted "primary" after the title change. Reintroducing checked: false cleared the value in both builds.

@changeset-bot

changeset-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5a69a74

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@solidjs/web Patch
@solidjs/diagnostics Patch
@solidjs/signals Patch
solid-js Patch
@solidjs/universal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed

codspeed Bot commented Nov 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

2 warnings

⚠️ Upgrade your CodSpeed plugin for Node.js 24

@codspeed/* 5.4.0 is only tested on Node.js 18, 20, and 22, so your Node.js 24 measurements may be inaccurate. Upgrade your @codspeed/* packages to 6.0.0 or later.

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 205 untouched benchmarks
⏩ 5 skipped benchmarks1


Comparing Marve10s:fix-web-release-removed-spread-binding (5a69a74) with main (caba92a)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

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.

1 participant