-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(radio-group): add compareWith property #28452
Conversation
Co-authored-by: Sean Perkins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality looks great. My comments are focused around the tests.
core/src/components/radio-group/test/compare-with/radio-group.e2e.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,37 @@ | |||
type CompareFn = (currentValue: any, compareValue: any) => boolean; | |||
|
|||
export const compareOptions = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a JSDoc for compareOptions too like we did for isOptionSelected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One naming change, but otherwise looks good. Great job!
Co-authored-by: Liam DeBeasi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@mapsandapps Don't forget to close #18943 too. GitHub doesn't autoclose linked issues when merging into the non-primary branch. |
@liamdebeasi thanks for the reminder! |
Issue number: resolves #18943
What is the current behavior?
Radio Group only allows for a strict equality check between the value and the options.
What is the new behavior?
compareWith
which can be a function or string.compareWith
is a string, the Radio Group will compare the value of that key.compareWith
is a function, the Radio Group will use that function to determine the selected option.Does this introduce a breaking change?
Other information
Docs PR is incoming.