Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'The results could not be loaded.' message during typing when request was cancelled by select2 #4870

Closed
eternalfame opened this issue Apr 13, 2017 · 11 comments

Comments

@eternalfame
Copy link

During the typing in select2 searchbox with 'ajax' option on in Chrome browser, select2 sends requests to server, and some of them it cancels. When it happens, the message 'The results could not be loaded.' appears in dropdown, then gets replaced with results. Seems a bit confusing.

Haven't tested in other browsers.

This bug happens also on the examples page (https://select2.github.io/examples.html)

Found such code in select2.full.js:

        // Attempt to detect if a request was aborted
        // Only works if the transport exposes a status property
        if ($request.status && $request.status === '0') {
          return;
        }

The condition here could be replaced with ($request.status && $request.status === '0' || $request.status === 0) condiiton, but I can't be sure than it doesn't break something else

@eternalfame
Copy link
Author

bug appears also in Firefox

@aalvrz
Copy link

aalvrz commented Aug 26, 2017

@eternalfame I started experiencing this all of a sudden. Seemed to work fine before.\

Did you find any solution?

@nelson6e65
Copy link
Contributor

I'm having this issue too. Specially noticeable in slow connections.

@kikonen
Copy link

kikonen commented Sep 28, 2017

Seeing this also, and given workaround fixes it. It seems that in JQuery status is 0, not "0", which triggers issue.

@lordplagus02
Copy link

lordplagus02 commented Oct 25, 2017

Is there a PR for this yet? I tried it myself but it didn't solve the issue for me.

@alexweissman
Copy link
Contributor

@lordplagus02 there is a fix in #4356, but it needs some test cases before it can be merged in.

@lordplagus02
Copy link

is it possible that there's also an issue with the delay option? It seems to actually ignore the delay for me, displaying the aforementioned "error" message before I'm done typing.

@lordplagus02
Copy link

My bad, just used the code from the PR, definitely fixes the issue.

@alexweissman
Copy link
Contributor

#4356 has been merged into the 4.0.6-rc.0 pre-release.

@raptor235
Copy link

Hey guys,

I'm still getting this issue... just downloaded latest version of ACF I'm seeing the following

http://www.flowpress.com/screenshots/screenshot_2018-02-14_at_6.50.21AM.png

ajax call returns the data

http://www.flowpress.com/screenshots/screenshot_2018-02-14_at_6.50.56AM.png

Any thoughts?

@canilao
Copy link

canilao commented Feb 20, 2018

@raptor235 according to this pull request, they will release in version 4.0.6.

#4356.

It looks like they merged and have a release candidate out. Check what version you're using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants