Skip to content

feat: accept readonly array for multiple combobox value#9741

Open
lixiaoyan wants to merge 2 commits intoadobe:mainfrom
lixiaoyan:feat/combobox-readonly-array-value
Open

feat: accept readonly array for multiple combobox value#9741
lixiaoyan wants to merge 2 commits intoadobe:mainfrom
lixiaoyan:feat/combobox-readonly-array-value

Conversation

@lixiaoyan
Copy link
Contributor

Summary

  • Port the readonly array changes from feat: accept readonly array for multiple select value #9221 (Select) to ComboBox
  • ValueType for multiple selection mode now uses readonly Key[] instead of Key[], allowing users to pass readonly arrays as the value prop
  • Added ChangeValueType (mutable Key[]) for the onChange callback, matching the Select pattern
  • Updated convertValue helper to accept readonly Key[]

Test plan

  • yarn check-types passes with no new errors
  • Verify that ComboBox with selectionMode="multiple" accepts readonly Key[] as value

🤖 Generated with Claude Code

Port the readonly array changes from adobe#9221 (Select) to ComboBox.
This allows passing `readonly Key[]` as the `value` prop for
multiple selection mode without TypeScript errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
if (value !== undefined && props.inputValue !== undefined) {
props.onSelectionChange?.(selectedKey);
props.onChange?.(displayValue);
props.onChange?.(displayValue as ChangeValueType<M>);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is the right approach. Perhaps we could also update the change type to a readonly array at some point?

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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