Open dilwit opened 10 years ago
This is still an issue - its a bit of a hack, however I coded a temporary work-around to enable my projects current code to be usable... as this was a complete blocker for us, as the client uses IE.
So... in the two places that the Autocomplete is instantiated I added the following code.
1) To the 'open' event:
this.box.autocomplete('widget').on({
mouseover: function () {
$(box).data('uiwidgetfocused', true);
},
mouseout: function () {
$(box).data('uiwidgetfocused', false);
}
});
2) Immediately after / oustside the code block above where the Autocompleted is instantiated:
var $box = this.box;
var originalClose = $(this.box).data("ui-autocomplete").close;
$(this.box).data("ui-autocomplete").close = function (event) {
var uiwidgetfocused = $($box).data('uiwidgetfocused');
if ((uiwidgetfocused === undefined) || !uiwidgetfocused) {
originalClose.apply(this, arguments);
}
};
Like I say.. its not beautiful, however it seems to work well and got me out of a pinch.
Cheers...
//WildStyle
Hi, i am unable to use above code block, can you guys show me how it looks in visualsearch.js.
Thanks Vinod
I got it working by commenting a line. I still need to do some testing to ensure that it does not break something else. LINE //this.box.bind('blur', this.deferDisableEdit);
// Rendering the input sets up autocomplete, events on focusing and blurring // the input, and the auto-grow of the input. render : function() { $(this.el).html(JST['search_input']({ readOnly: this.app.options.readOnly }));
this.setMode('not', 'editing');
this.setMode('not', 'selected');
this.box = this.$('input');
this.box.autoGrowInput();
this.box.bind('updated.autogrow', this.moveAutocomplete);
//this.box.bind('blur', this.deferDisableEdit);
this.box.bind('focus', this.addFocus);
this.setupAutocomplete();
return this;
},
I tried the url http://documentcloud.github.io/visualsearch/ on IE 8/9 and selected 'country' from the filter, when I click on scroll bar and trying to drag of the listed countries it disappears.