I'm in need of an autocomplete scroll bar ( I have hundreds of taxonomy terms). I realize out of the box, the autocomplete widgets do not provide the option. So, I added some css as follows:

#autocomplete {
height: 100px;
max-height: 100px;
overflow: auto;
overflow-y: auto;
overflow-x: hidden;
}

Well, this worked great, in Firefox. In IE8, when I click on the scroll bar, the drop down disappears. Ugghhh! Has anyone implemented an autocomplete scrollbar...that works in FF and IE? Is there a workaround? Any help would be greatly appreciated. Thanks for viewing!

Comments

emman31’s picture

I did about the same, and I faced the same problem.

editing the autocomplete.js worked for me.

I just changed Drupal.jsAC (on line 34), a bit :

Drupal.jsAC = function (input, db) {
  var ac = this;
  this.input = input;
  this.db = db;
  
  $(this.input)
    .keydown(function (event) { return ac.onkeydown(this, event); })
    .keyup(function (event) { ac.onkeyup(this, event); })
    .blur(function () {
    	// On IE, if we click on the scrollbar, blur event is fired.
    	if(ac.selected === false && document.activeElement.id == "autocomplete"){
    		input.focus();
    	}else{
    		ac.hidePopup(); 
	    	ac.db.cancel(); 
    	}
    });

};

p.s. : this doesn't work for Chrome, Safari

nod_’s picture

Version: 6.19 » 8.x-dev
Category: support » feature
Status: Active » Closed (duplicate)

Once we use jquery ui autocomplete that will be solved.
#675446: Use jQuery UI Autocomplete

pmchristensen’s picture

Version: 8.0.x-dev » 7.x-dev
Category: Feature request » Bug report
Issue summary: View changes
Status: Closed (duplicate) » Patch (to be ported)
StatusFileSize
new1.48 KB

This is still a problem in Drupal 7, so have changed the issue category, status and version (Sorry if this is incorrect).

Made a backport patch for Drupal 7 - 7.x branch with the idea from #1, which is cross browser compatible so the autocomplete element wont disappear if you try to catch and drag it/use the scrollbar arrows.

David_Rothstein’s picture

Status: Patch (to be ported) » Needs review

Pretty close - just change the status to "needs review" though so people will know there's a Drupal 7 patch here to review :)

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.