Skip to content

fix(ComboBox): don't commit value on blur when isReadOnly - #10869

Open
mangeshraut712 wants to merge 4 commits into
adobe:mainfrom
mangeshraut712:tip-10846
Open

mangeshraut712 wants to merge 4 commits into
adobe:mainfrom
mangeshraut712:tip-10846

Conversation

@mangeshraut712

Copy link
Copy Markdown
Contributor

Summary

A read-only ComboBox still ran commitValue() on blur. When both value and inputValue are controlled and the selected item is not in the collection (e.g. async items not loaded yet), that path fires change events and apps that derive input text from the selection can clear a field the user never changed.

Skip the blur commit when isReadOnly is set.

Closes #10846

Test plan

  • RAC ComboBox: controlled isReadOnly with a value missing from the collection does not fire onChange / onSelectionChange on blur

@mangeshraut712

Copy link
Copy Markdown
Contributor Author

CI is green on this one. Ready for review/merge when you have a chance — thanks.

@nwidynski

Copy link
Copy Markdown
Contributor

LGTM. Thanks!

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.

ComboBox fires change events on blur when isReadOnly, clearing a fully controlled value that is not in the collection

3 participants