Repository navigation
feat(select): add compareWith property - #17358
Conversation
update to latest 1-22-19
Update master 2-1-19
|
ETA for this? |
|
@remisture 🤷♂️ Whenever the Ionic team reviews it. Hard to say.. |
|
Thank you for the PR! I have this added to review for My only request at first glance is could you please move the test out of the |
|
Will do @brandyscarney! |
liamdebeasi
left a comment
There was a problem hiding this comment.
This is looking really good so far!
… into feat-select-track-by merge
|
Thank you @zakton5 ! |
| if (typeof compareWith === 'function') { | ||
| return compareWith(currentValue, compareValue); | ||
| } else if (typeof compareWith === 'string') { | ||
| return currentValue[compareWith] === compareValue[compareWith]; |
There was a problem hiding this comment.
This object comparison using a string is not null-safe. It doesn't check for the currentValue/compareValue to be set nor being an object.
Short description of what this resolves:
Using objects as values was only supported by comparing object equality (
===) but not by content. This PR adds acompareWithproperty that accepts a property name (ieid) or a function of the shape(o1, o2) => booleanthat is used to determine equality.Changes proposed in this pull request:
compareWithpropcompareOptionsIonic Version: 4.0.0
Fixes: #14598