Closed mackuba closed 14 years ago
You're correct about point 1. I'll look again when I have more time about point 2.
Fixed and pushed, thanks.
Try running a query on a collection of objects with a single field "name". I have such case and I'm getting a whole list of results with "null: undefined" below them, because topMatch is null (it's initialized to null and it isn't changed if it's the name field).
If you're convinced of this, I'll make the change without running through the code myself.
The 'if' in defaultRenderFunction checks whether topMatch is equal to 'name', but:
1) name field doesn't have to be called 'name'; 2) name field should never appear in topMatch anyway (see line: if ((field != config.nameField) ...)
I guess this should be "if (topMatch === null)" instead.