Repository navigation
fix(combobox): resolve reactive item labels instead of stringifying them - #1185
Open
harshasiddartha wants to merge 1 commit into
Open
harshasiddartha wants to merge 1 commit into
harshasiddartha wants to merge 1 commit into
Conversation
|
Contributor
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
|
Hi, how long does it usually take to have the fix released? |
harshasiddartha
force-pushed
the
fix/combobox-object-in-input
branch
from
September 27, 2026 21:09
a74259b to
82cac1d
Compare
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.
What is it?
Why is it needed?
Fixes #1184
Selecting an item in the headless Combobox writes
[object Object]into the input whenever the item label is a reactive expression.Root cause
combobox-inline-comp.tsxbuilds the items map at pre-render time and casts the label's children straight to a string:That holds for a literal (
<Combobox.ItemLabel>Apple</Combobox.ItemLabel>), but when the label comes from a reactive expression - e.g.{user.label}whereusercomes from auseStore- the optimizer turns those children into a derived signal. The cast lies, and the signal object is what gets written toinputRef.value.valueinselectionManager$. I confirmed this by decoding the Qwik state of a rendered page: the map entries serialize with Qwik's derived-signal marker (�n! label) rather than as strings.The same bad value also flows into the default filter (
displayValue.toLowerCase()incombobox-item.tsx), so filtering silently breaks for those items too.Fix
Unwrap the children before storing the display value: resolve signals (recursively), join arrays of children, and stringify the rest. String labels take exactly the same path as before, so this is backwards compatible.
Verification
Added a
storeexample (items whose labels come from a store) and a regression test incombobox.test.ts. It fails onmainand passes with the fix:Full combobox suite (
--retries=2 --workers=1): 69 passed, 2 flaky, 1 failed. The one failure -combobox.test.ts:253(the latest selected option should be highlighted when the menu is opened again) - also fails on unmodifiedmainon my machine, so it is pre-existing and unrelated to this change.nx lint headlessandnx build headlessboth pass.Note:
select-inline.tsxhas the samechild.props.children as stringcast and is likely affected by the same problem, but I left it out to keep this PR scoped to the reported issue. Happy to follow up.Checklist:
pnpm changeand documented my changes