Search and Top Navigation
#6989 closed bug (notabug)
Opened February 15, 2011 12:05AM UTC
Closed February 15, 2011 01:28AM UTC
Last modified February 15, 2011 01:46PM UTC
AutoComplete is actually AutoSuggest
Reported by: | hm2k | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.autocomplete | Version: | 1.8.9 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
You would expect AutoComplete to "complete" the phrase you are typing, but instead it "suggests" based on the characters you are typing.
For example: http://jqueryui.com/demos/autocomplete/
When you type "a" in the input box:
I expect it to "complete" and display:
Actually, it "suggests" and displays any word that contains that letter.
Here's an example on how you would expect it to work:
http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_array.html
Attachments (0)
Change History (6)
Changed February 15, 2011 01:28AM UTC by comment:1
component: | ui.core → ui.autocomplete |
---|---|
resolution: | → invalid |
status: | new → closed |
Changed February 15, 2011 09:30AM UTC by comment:2
- This is not the default, as expected
- There is no example of changing the search logic
Changed February 15, 2011 10:04AM UTC by comment:3
In fact, there are four examples of changing the search logic:
1. http://jqueryui.com/demos/autocomplete/#combobox
2. http://jqueryui.com/demos/autocomplete/#folding
3. http://jqueryui.com/demos/autocomplete/#multiple
4. http://jqueryui.com/demos/autocomplete/#remote-with-cache
Changed February 15, 2011 11:12AM UTC by comment:4
Granted, but none of them show the expected behaviour of an "autoComplete", these are all autoSuggest behaviour.
Further more, these examples seem to show a custom source, rather than custom search logic.
Perhaps you could clarify what you meant, because it is not clear from the examples or documentation.
Changed February 15, 2011 01:24PM UTC by comment:5
_comment0: | Sorry you didn't find clarity in the examples I shared. A custom source is exactly how you implement custom search logic. Here's a better example that matches from the beginning of the string: http://jsbin.com/avoyu5 → 1297776347312560 |
---|
Sorry you didn't find clarity in the examples I shared. A custom source is exactly how you implement custom search logic. Here's a better example that matches from the beginning of the string: http://jsbin.com/avoyu5
$( "#tags" ).autocomplete({ source: function( request, response ) { var matches = $.map( availableTags, function(tag) { if ( tag.toUpperCase().indexOf(request.term.toUpperCase()) === 0 ) { return tag; } }); response(matches); } });
Changed February 15, 2011 01:46PM UTC by comment:6
Thanks for the clarification.
I propose that an example of expected behaviour should included in the documentation.
You can change the searching logic to whatever you want.