Skip to content

TEST: for reproducing an issue with value set on outside click#189

Closed
rreckonerr wants to merge 1 commit into
GavinJoyce:masterfrom
rreckonerr:repro/wrong-value-set-on-click-outside
Closed

TEST: for reproducing an issue with value set on outside click#189
rreckonerr wants to merge 1 commit into
GavinJoyce:masterfrom
rreckonerr:repro/wrong-value-set-on-click-outside

Conversation

@rreckonerr

Copy link
Copy Markdown
Contributor

Refs: #188

GavinJoyce added a commit that referenced this pull request Dec 20, 2025
Swap order in handleOptionClick to call onChange before setSelectedOption,
so this.args.value is already updated when setSelectedOption runs.
Also set inputValue to immediately reflect the selection.

Includes test from PR #189.
GavinJoyce added a commit that referenced this pull request Dec 20, 2025
Fixes #188 - Combobox now correctly preserves selected values when
clicking outside after selecting a non-primitive option.

Root cause: In handleOptionClick, setSelectedOption was called before
onChange, so this.args.value hadn't been updated yet.

Changes:
- Swap order in -option.js: call onChange first, then setSelectedOption
- Set inputValue in setSelectedOption so input immediately reflects selection
- Add test from PR #189 for non-primitive values with displayValue
@GavinJoyce

Copy link
Copy Markdown
Owner

rolled into #193, thanks

@GavinJoyce GavinJoyce closed this Dec 20, 2025
@rreckonerr

Copy link
Copy Markdown
Contributor Author

Thanks for looking into it!

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