Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#6989 closed bug (notabug)

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:


You would expect AutoComplete to "complete" the phrase you are typing, but instead it "suggests" based on the characters you are typing.

For example:

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:

Change History (6)

comment:1 Changed 12 years ago by Scott González

Component: ui.coreui.autocomplete
Resolution: invalid
Status: newclosed

You can change the searching logic to whatever you want.

comment:2 Changed 12 years ago by hm2k

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

comment:4 Changed 12 years ago by hm2k

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.

comment:5 Changed 12 years ago by rdworth

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:

$( "#tags" ).autocomplete({
  source: function( request, response ) {
    var matches = $.map( availableTags, function(tag) {
      if ( tag.toUpperCase().indexOf(request.term.toUpperCase()) === 0 ) {
        return tag;
Last edited 12 years ago by rdworth (previous) (diff)

comment:6 Changed 12 years ago by hm2k

Thanks for the clarification.

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

Note: See TracTickets for help on using tickets.