jquery-autocomplete icon indicating copy to clipboard operation
jquery-autocomplete copied to clipboard

Empty server response may be interpreted as one "empty" result

Open Xion opened this issue 11 years ago • 0 comments

When server returns empty (zero-length) response and there is no filter specified (filter: false), the autocomplete results are not completely empty length. Instead, the result array is of length one, and its sole element is:

{ data: [], value: "" }

that is, a completely 'empty' item.

I've identified the culprit as the usage of standard JavaScript String.split inside plainTextParser function. For empty strings, splitting with non-empty delimiter produces [""], i.e. an array of one empty string.

I can prepare pull request to fix the issue, but would like to inquire first whether it was an intended behavior or simply a bug.

Xion avatar Aug 15 '13 20:08 Xion