Skip to content

feat(material/radio): add compareWith support to mat-radio-group - #34092

Open
almas77abolfazl wants to merge 1 commit into
angular:mainfrom
almas77abolfazl:feat-radio-group-compare-with
Open

almas77abolfazl wants to merge 1 commit into
angular:mainfrom
almas77abolfazl:feat-radio-group-compare-with

Conversation

@almas77abolfazl

Copy link
Copy Markdown

Adds a \compareWith\ input to \MatRadioGroup\ to allow customizing how option values are compared with the selected/form value. This mirrors the behavior in \MatSelect\ when using complex objects as values.

Changes:

  • Added \compareWith\ input property to \MatRadioGroup\ with default to object equality (===).
  • Added \getMatRadioNonFunctionValueError\ error helper.
  • Handled comparison in _updateSelectedRadioFromValue\ using the custom comparator.
  • Added comprehensive unit tests in
    adio.spec.ts\ covering value comparison, comparator update, and error throwing.
  • Updated documentation in
    adio.md.

Fixes #10495

Adds a compareWith input to MatRadioGroup allowing customization of how option values are compared with the form/selected value. This mirrors the behavior in MatSelect when using complex objects.

Fixes angular#10495
@pullapprove
pullapprove Bot requested review from ok7sai and tjshiu November 6, 2026 22:36
@google-cla

google-cla Bot commented Nov 6, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: material/radio labels Nov 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: material/radio detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'compareWith' option to mat-radio-group just like mat-select

1 participant