yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.8k stars 467 forks source link

Unable to use twitter bootstrap typeahed #77

Closed geaden closed 11 years ago

geaden commented 11 years ago

I have no idea how to make twitter bootstrap typeahed working with django-autcomplete-light. Is it possible?

jpic commented 11 years ago

It is of course possible, but fairly hard.

The easiest would be to provide autocomplete-light with the features from bootstarp typeahead.

Why would you prefer bootstrap typeahead over the current script ?

geaden commented 11 years ago

Thanks for reply @jpic! Actually, I have some issue with productivity of autocomplete-light (i.e. when user enters data into inputbox, no suggestions appears((( when user deletes one character suggestion appears...) I try to solve it by using bootstrap typeahead (we currently use it in our project), because it's more user-friendly. Anyway thanks for autocomplete-light. It saved me hours. I'm really sure this app will envolve.

jpic commented 11 years ago

Could you tell me how to reproduce this issue step by step ? You can use the test project on jpic.pythonanywhere.com

geaden commented 11 years ago

I've just tested on visited cities. Here is a screenshot Screen Shot 2012-12-12 at 2 24 25 PM I know I'm hypercritical...

jpic commented 11 years ago

On Wed, Dec 12, 2012 at 11:27 AM, Gennady notifications@github.com wrote:

I've just tested on visited cities. Here is a screenshot

I think I see it, this happens when typing "mo" very fast, but not if "mo" is typed slowly. Can you confirm that ?

I know I'm hypercritical...

It's alright let's make it as good as bootstrap typeahead :)

geaden commented 11 years ago

Yes, I think it happens if I'm typing very fast. But it seems that sometimes suggestions appear anytime and sometimes suggestions appear like on screenshot...

jpic commented 11 years ago

I think commit ce1320aaa56 fixes it.

Could you confirm that ? Then I'll make a release including the fix :)

jpic commented 11 years ago

Also, can you still reproduce it on jpic.pythonanywhere.com ? I just updated it (be carefull with your browser cache, I had to reload with CTRL+SHIFT+R a couple of times with Chromium, ensure that this.xhr.abort() is not at the beginning of Autocomplete.fetch anymore) and I can't reproduce your screenshot anymore, so that's encouraging.

geaden commented 11 years ago

Great job! It seems it works much faster

jpic commented 11 years ago

1.1.6 released :sunglasses:

Look at your credit: https://github.com/yourlabs/django-autocomplete-light/commit/a4d025e35c7d612b90137137c09bc7e3d5d9bb26#L0R6

Please, open another issue if you find something better in typeahead !! I'm counting on you hehe

geaden commented 11 years ago

=) Thank you very much. Ok, I'll keep searching...

jpic commented 11 years ago

No problem, I'm just trying to provide the maintainance and support that I'd like to have as a user.

Criticism is welcome !

jpic commented 11 years ago

Hello, I've updated the typeahead branch to use django-admin-bootstrapped, and the autocomplete seems to work.

Could you please review both django-autocomplete-light 1.1.9 which has a rewritten keypress handler that should not get in the way and the typeahead branch ?

Thanks !!

geaden commented 11 years ago

Hello! Ok, I will as soon as possible. Thanks!!! On Jan 21, 2013 9:16 PM, "James Pic" notifications@github.com wrote:

Hello, I've updated the typeahead branch to use django-admin-bootstrapped, and the autocomplete seems to work.

Could you please review both django-autocomplete-light 1.1.9 which has a rewritten keypress handler that should not get in the way and the typeahead branch ?

Thanks !!

— Reply to this email directly or view it on GitHubhttps://github.com/yourlabs/django-autocomplete-light/issues/77#issuecomment-12507442.

jpic commented 11 years ago

Actually I've got a problem in typeahead branch: you must either click very fast, either double click on a choice.

Keyboard ENTER works... Anyway, I'm still interrested in your feedback.

geaden commented 11 years ago

Hello, @jpic! Sorry, I couldn't test typeahead branch earlier. By the way, new update is very great. So, I've tested django-autocomplete-light typeahead branch in my "application". Here are results: In my form, I provide attribute to my autocomplete field data-provide as it said in bootstrap documentation. I use crispy-forms, so my code for the field looks something like that:

Field('member', data_provide = 'typeahead'),

Generated html looks like that:

<input type="text" class="autocomplete" name="member-autocomplete" id="id_member_text" value="" data-provide="typeahead" autocomplete="off" style="display: inline-block;">

As you can mention I have empty atribute value. There is a cache issue for me. When I open page with create view, my autocomplete field is already filled with some value from database. Still don't know how to fix it.

Next, in browser, when I click autocomplete-field It appears drop-down list with all records from database (I've not started typing yet). See the following screenshot Screen Shot 2013-01-22 at 11 09 15 PM To select suggested value one click of mouse button was enough for me. Keyboard works ok as well. Also when I'm typing my typed letters are not getting bold in suggested choice: Screen Shot 2013-01-22 at 11 09 40 PM as it looks in the original twitter bootstrap: Screen Shot 2013-01-22 at 11 09 54 PM

Hope, it could be helpful for you.

Great job! Keep it going!

Thanks.