solidjs / solidjs/solid

Value of `<select>` is set before the children are created when using spread

Open
#1,754 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
36.1k
Forks
1.1k
Avg merge
9h 18m
Merged PRs (30d)
195

Description

Describe the bug

When using spread on a select element the value will be set before the children are created and this will cause the value to be set to an empty string (this is a browser behavior because no option match).

Your Example Website or App

https://playground.solidjs.com/anonymous/d2bf2e03-5e3b-4a9c-a5c0-37a62bbc8f9c

Steps to Reproduce the Bug or Issue
  1. Open the example
  2. Look at the result
Expected behavior

The second and third select boxes should have the same option selected.

Screenshots or Videos

No response

Platform
  • OS: Windows
  • Browser: Edge
  • Version: 113
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Solid playground reproduction and inspect how spread props are applied to the element and its children. Reproduce the mismatch, then verify that the second and third select boxes retain the same selected option after their children are created.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.