Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #5231 [Bug] Fixing tomselect over-filtering Ajax autocomplete res…
…ults (weaverryan) This PR was merged into the 4.x branch. Discussion ---------- [Bug] Fixing tomselect over-filtering Ajax autocomplete results Hi! While playing with tomselect in another project (and also experimenting with its behavior in our Symfonycasts admin area), I noticed that it sometimes "over-filters" the results. Example: suppose: A) there is an autocomplete for a `User` entity, and `User.email` is the stringified version of that object. B) My email is `ryan@symfonycasts.com` but I have a `User.lastName` set to `weaver`. When I search for "weaver", the Ajax endpoint DOES return my user record. But then, TomSelect filters it out because the `entityAsString` (which is `ryan@symfonycasts.com`) does not contain `weaver`. This PR fixes that by overriding the `score` function. Normally, this function returns `0` for the result above, which then apparently causes TomSelect to hide it completely. Cheers! Commits ------- 4501e55 Fixing problem where tomselect over-filtered Ajax autocomplete results
- Loading branch information