Update AsyncExample.js#578
Conversation
Do not filter results in async example
Codecov Report
@@ Coverage Diff @@
## master #578 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 44 44
Lines 658 658
Branches 133 133
=======================================
Hits 657 657
Misses 1 1 Continue to review full report at Codecov.
|
|
Hey @ET-CS, thanks for submitting this PR. Seems like a reasonable change. I've been debating whether this should actually be the default value in |
|
Thank you @ericgio . IMHO this should actually be the default value in |
This PR adds
filterBy={() => true}to theAyncExample.It's an issue when the server is filtering by multiple fields (such as name, family-name, email, tags, etc..)
and then, if the client
labelKeyis only byname(for example), no result will be shown.Ones can set the
labelKeyto have all the fields inside or createfilterByarray on all the fields (which is not always possible, and sometimes even the backend doesn't return all the fields to the client).Also, when filtering server-side, it's a waste to filter again in client-side all results.
IMHO It's important thing to be in the example, as in our case, took us few hours to find this out and we unfortunately first tried to set the
labelKeyto${name} ${email}and then override bothrenderInput,renderTokenandrenderMenuItemChildrento show only thenamefield...