Skip to content

autocomplete not working #177

@g-teley

Description

@g-teley

jQuery Autocomplete with ajax loaded values works fine as long as you're using the physical keyboard. If I enter 2 characters through the virtual keyboard, I see these characters but no autocomplete list. If I enter the third character on the physical keyboard it shows the first list. So the physical entered data correctly appends to the virtual entered data. Tried to leave out the Ajax part and use some simple words as test, same behaviour. Checked IE, Firefox, Chrome: all the same. Also selecting a value from the autocomplete list through the mouse doesn't work.
Tested with:
<... load jQuery, virtual keyboard, CSS etc...>
$(document).ready(function() {
$(function() {
function log(message) {
$("

").text(message).prependTo("#log");
$("#log").scrollTop(0);
}
$('#sometext').keyboard({
usePreview: false,
position: {at: 'right bottom', of: '#log'}
}).autocomplete({
source: ['One', 'Two', 'Three', 'Musketiers'],
minLength: 1,
select: function(event, ui) {
if (ui.item) {
log("Selected: " + ui.item.label);
}
}
}).addAutocomplete();
});
});

It looks like the Mottie Virtual keyboard can't find the jQuery autocomplete. In the source (line 88 onwards) it says:

// set up after keyboard is visible
base.autocomplete_setup = function() {
// look for autocomplete
base.$autocomplete = base.$el.data('autocomplete');
base.hasAutocomplete = (typeof(base.$autocomplete) === 'undefined') ? false : (base.$autocomplete.options.disabled) ? false : true;

As it turns out, base.hasAutocomplete is false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions