Skip to main content

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:

ActionScript

AppleScript

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 scottgonzalez comment:1

component: ui.coreui.autocomplete
resolution: → invalid
status: newclosed

You can change the searching logic to whatever you want.

Changed February 15, 2011 09:30AM UTC by hm2k comment:2

  • This is not the default, as expected
  • There is no example of changing the search logic

Changed February 15, 2011 11:12AM UTC by hm2k 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 rdworth 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/avoyu51297776347312560

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 hm2k comment:6

Thanks for the clarification.

I propose that an example of expected behaviour should included in the documentation.