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

AJAX data source "the results could not be loaded" error #4355

Closed
13 of 16 tasks
MichaelMackus opened this issue May 11, 2016 · 14 comments
Closed
13 of 16 tasks

AJAX data source "the results could not be loaded" error #4355

MichaelMackus opened this issue May 11, 2016 · 14 comments

Comments

@MichaelMackus
Copy link
Contributor

MichaelMackus commented May 11, 2016

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate
  • The issue still exists against the latest master branch of Select2
  • This is not a usage question (Those should be directed to the community)
  • I have attempted to find the simplest possible steos to reproduce the issue
  • I have included a failing test as a pull request (Optional)

Steps to reproduce the issue

  1. Navigate to: https://select2.github.io/examples.html#data-ajax
  2. Input text
  3. Before the ajax results are loaded, input more text

Expected behavior and actual behavior

When I follow those steps, I see...

"The results could not be loaded." is displayed (then, after a while, the results are populated)

I was expecting...

"Searching.." displayed as more text is inputted

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version: v1.11.2
  • Select2 version: master (v4.0.2#master)

Isolating the problem

  • This bug happens on the examples page
  • The bug happens consistently across all tested browsers
  • This bug happens when using Select2 without other pluigns
  • I can reproduce this bug in a jsbin
MichaelMackus added a commit to MichaelMackus/select2 that referenced this issue May 11, 2016
Fixes select2#4355

Verified in Firefox & Chromium
@arirangz
Copy link

+1

@stephpy
Copy link

stephpy commented Jun 21, 2016

Tested on macos x, same issue. fixed by #4356.

@rajdeep26
Copy link

What's the temporary solution till this bug is fixed?

@vlad-datacat
Copy link

A workable cover up for people that cant edit the source code due to loaded by bower / dependencies etc, but just want to hide the ugly message:

...).select2({ language: { errorLoading:function(){ return "Searching..." } },

@JefMari
Copy link

JefMari commented Feb 22, 2017

@vladkazantsev 's approach works for me :)

@bpromasmb
Copy link

@vladkazantsev doesn't work if you've already set an alternate language. Also it doesn't display the message correctly if there is an actual error to the search.

If you're loading an alternate language file you could go into the file and change the errorLoading text, which would then affect every Select2 in your application, or you could generate a new language file with the changed errorLoading text to use just on the selects that have ajax search.

@bpromasmb
Copy link

One solution is to roll back to v.4.0.1 which does not have this issue as far as I can tell.

@Braunson
Copy link

Braunson commented Apr 23, 2017

@vladkazantsev approach works IF you don't have an alt language set, additionally if you DO have an error, it just sits there showing 'Searching...'.

Ideally until this is resolved @bpromasmb's suggestion of downgrading to 4.0.1 resolves this.

This has has been an issue for a year a working solution , can we have it merged please 🍒 ?

achimha pushed a commit to achimha/select2 that referenced this issue May 2, 2017
achimha pushed a commit to achimha/select2 that referenced this issue May 3, 2017
@raratiru
Copy link

+1

@alexweissman
Copy link
Contributor

Please refrain from "+1" comments. Simply click 👍 to show your interest in an issue.

alexweissman pushed a commit that referenced this issue Oct 26, 2017
Fixes #4355

Verified in Firefox & Chromium
@KuenzelIT
Copy link

I have the same problem. Is there a solution now? Can it be merged? Thank you!

@alexweissman
Copy link
Contributor

Have you updated to 4.0.6-rc.0? It should be fixed since #4356 was merged.

@KuenzelIT
Copy link

Hey,
I took version 4.0.4 as it is linked one the official installation page:
https://select2.org/getting-started/installation

I'll try the new version, thanks for the hint!

@alexweissman
Copy link
Contributor

Ah ok, I will update the docs.

@select2 select2 locked and limited conversation to collaborators Dec 17, 2017
@select2 select2 unlocked this conversation Dec 17, 2017
@select2 select2 locked as resolved and limited conversation to collaborators Dec 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests