Skip to content

[6.x] fix(combobox): handle object values in selectedOptions lookup#14452

Closed
waldemar-p wants to merge 1 commit intostatamic:6.xfrom
waldemar-p:6.x
Closed

[6.x] fix(combobox): handle object values in selectedOptions lookup#14452
waldemar-p wants to merge 1 commit intostatamic:6.xfrom
waldemar-p:6.x

Conversation

@waldemar-p
Copy link
Copy Markdown
Contributor

The selectedOptions computed property failed to find matching options when modelValue contained full option objects (e.g., {label, value}) instead of primitive values. This caused the #selected-option slot to receive fallback objects with incorrect labels.

Now properly extracts the optionValue from object-type values before performing the lookup, ensuring the full option object is returned to slot templates.

The selectedOptions computed property failed to find matching options when
modelValue contained full option objects (e.g., {label, value}) instead of
primitive values. This caused the #selected-option slot to receive fallback
objects with incorrect labels.

Now properly extracts the optionValue from object-type values before
performing the lookup, ensuring the full option object is returned to
slot templates.
@waldemar-p waldemar-p changed the title fix(combobox): handle object values in selectedOptions lookup [6.x] fix(combobox): handle object values in selectedOptions lookup Apr 7, 2026
@waldemar-p waldemar-p mentioned this pull request Apr 7, 2026
@duncanmcclean
Copy link
Copy Markdown
Member

duncanmcclean commented Apr 8, 2026

Thanks for the pull request! 🙌

This only seems to cover the "currently selected options" case though. There's a lot of other places we assume the value is going to be a string, or an array of strings.

For example:

  • If you select another option, its value will be added to the array, rather than the option's object.
  • When multiple="false", the page doesn't load and you get a bunch of console errors.
  • You can't deselect items.
CleanShot.2026-04-08.at.11.22.58.mp4

We're also in the midst of a big rewrite of the Combobox (#13843) to improve performance and the UX. Merging this now would lead to a bunch of merge conflicts.

For these reasons, I'm going to close this PR. We can re-consider once the rewrite has been merged. Thanks for your understanding!

@waldemar-p
Copy link
Copy Markdown
Contributor Author

Thanks for the infos and the feedback.
Those are very valid points.

I'll then patiently wait for the rewrite of the Combobox. :)

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.

2 participants