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.81k stars 468 forks source link

Empty Select No dropdown on iOs users #1261

Closed bopnrgi closed 3 years ago

bopnrgi commented 3 years ago

Hello,

There is a problem with iOS users: on Safari and Chrome. (Test on iPhone, no possibility to test on Mac)

When a user clicks on the field where autocompletion is available, the "classic" list for Select fields is displayed empty. Unable to get the text field where the user must enter his request.

For all users on PC (Ubuntu, Windows) and all browsers the code is functional. Likewise for the vast majority of Android users, it works.

I have no idea where to look ....

JackAtOmenApps commented 3 years ago

Experiencing the same with both Safari and Chrome on iPad (7th gen).

Using autocomplete.ModelSelect2Multiple in my forms. On any other browser they work as expected. But in Safari, it shows '0 items'.

rec-code commented 3 years ago

I am facing the same problem here. On any other browser, the select workis well, on ios we've notice that happening. I am using 3.8.2 version

aroraumang commented 3 years ago

Seems like it's working on master. Was breaking for me on 3.8

JackAtOmenApps commented 3 years ago

@aroraumang I'll give that a try this evening. Thanks.

belegnar commented 3 years ago

Looks like a kind of minimizer problem

[Error] SyntaxError: Invalid regular expression: invalid group specifier name
    (anonymous function) (autocomplete_light.min.js:1)
bopnrgi commented 3 years ago

@belegnar this issue is not linked to the minimizer (i think) because it works with autocomplete_light.min.js on other devices) @aroraumang : it worked with previous version ?

rblack commented 3 years ago

I had a similar problem with Safari on iOS and macOS. Version 3.8.2 on pypi has incompatible with Safari regex here https://github.com/yourlabs/django-autocomplete-light/blob/916af81ebeaaa65d53987c19427706da65a3cb51/src/dal/static/autocomplete_light/autocomplete_light.js#L128 Solved by monkey patching autocomplete_light.js with replaced regex from master https://github.com/yourlabs/django-autocomplete-light/blob/925bed816586a41bf5f959eb5b041e84b49d94eb/src/dal/static/autocomplete_light/autocomplete_light.js#L128 If you see "SyntaxError: Invalid regular expression: invalid group specifier name" in Safari's console, then you can use the aforementioned fix.

oxpeter commented 3 years ago

Thanks @rblack - I had the "SyntaxError" message in Safari's console, and your alteration worked (after I remembered that Django's runserver hosts static files differently when debug=True, and altered the correct js file)

leetucker commented 3 years ago

I have been experiencing the same issue, and switching to the latest master helped. It does look like the issue flagged by @rblack was the culprit.

jpic commented 3 years ago

Released in 3.9.0rc2, please reopen if necessary.