3

I'm using the jQuery typeahead plugin to autocomplete countries in both french and english.

It works ok, even when accents are used as the countries are fetched the way they should in both languages. The only thing is that, as soon as the user types manually the accents, the input field stops displaying the hint.

Ultimately this is how it evolves as the user types the word:

A lgérie ok)

Al gérie (ok)

Alg érie (ok)

Algé (not ok)

Algér (not ok)

Algéri (not ok)

Algérie

Keep in mind that the box below the input field (showing all the words matching the input) will keep on displaying "Algérie", as expected, even when the hint is not displayed anymore.

So, it seems that there is nothing wrong with MySQL as the data is clearly fetched and the accent recognized as such but the hint will just not work as soon as the user has typed the accent (but before typing this accent, the hint will display the accent, that's not a problem).

What can I do about that?

This is how I call the plugin:

$('.filterbox_location').typeahead({
    remote : 'library/other/filter_validate/autocomplete_location.php?query=%QUERY',
    minLength: 1
});

I don't display the php script as it is irrelevant since it is clear that the data is fetched. The problem comes afterward when typeahead is handling the input.

If necessary, I will give the php code of course.

Baylock
  • 1,246
  • 4
  • 25
  • 49

1 Answers1

0

Take a look of this recent solution: https://github.com/twitter/typeahead.js/issues/271

Regards!

candlejack
  • 1,189
  • 2
  • 22
  • 51