[Autocomplete] Rename getOptionSelected to isOptionEqualToValue#26173
[Autocomplete] Rename getOptionSelected to isOptionEqualToValue#26173
getOptionSelected to isOptionEqualToValue#26173Conversation
getOptionSelected to isOptionEqualToValue
eps1lon
left a comment
There was a problem hiding this comment.
Isn't this function just areOptionsEqual<T>(optionA: T, optionB: T): boolean? As far as I can tell value is synonymous with selectedOption.
|
The nominal use case for the prop we are discussing is when the I don't follow the implementation detail aspect. This comparison prop only exists because there are two different props: |
We're not comparing options with options. This function compares an option with the selected value (or values, if multiple). |
|
So I guess this is a matter of angle we pick to look at the problem.
I would vote for giving less weight to the type in this very instance as we have indicators in #23708 that sharing the same type might not be ideal. |
|
May I push forward this one? I feel we didn't come to an agreement about the name: |
|
@m4theushw What's your preference on the naming Y? Looking a bit closer at #23708. If we implement a In https://select2.org/getting-started/basic-usage, it's actually simpler, they force you to have the equivalent of |
|
Just looking on what we have now, I would rename to If we implement the |
Ok, let's move forward with this then. |
Breaking changes
[Autocomplete] Rename
getOptionSelectedtoisOptionEqualToValueto better describe its purpose.Part of #20012
Closes #24855
In the RFC, the suggestion was
optionEqualValue, but I thinkisOptionEqualToValueis a better name. It was suggested in #24855 (comment).