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 abort request doesn't exit and display the error loading message #4781

Closed
10 of 16 tasks
laudeco opened this issue Feb 8, 2017 · 6 comments
Closed
10 of 16 tasks

Comments

@laudeco
Copy link

laudeco commented Feb 8, 2017

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 steps to reproduce the issue
  • I have included a failing test as a pull request (Optional)

Steps to reproduce the issue

  1. Click and search something in the search box
  2. During the search type something else
  3. The abort message is present waiting the response of the latest query

Expected behavior and actual behavior

When I follow those steps, I see...
The errorLoading message

I was expecting...
The searching message

Environment

Browsers

  • Google Chrome : 56.0
  • Mozilla Firefox
  • Internet Explorer

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version: 1.11.2
  • Select2 version: 4.0.3

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

Causes

In the select.full.js file on line 3472 of 4.0.3 version.

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

        self.trigger('results:message', {
          message: 'errorLoading'
        });
      });

The status code is always an int in my browser so when it's an abort request the status is 0 . It means that it will never rich the return; .

@laudeco
Copy link
Author

laudeco commented Feb 14, 2017

No news about this ?

@jpic
Copy link
Contributor

jpic commented Feb 15, 2017

Couldn't reproduce on Chromium 56, tried:

  • "Loading remote data example",
  • in the Network tab of webkit inspector, set Throttling: GPRS,
  • type "django"
  • replace it with "node" very fast

I have just seen the "searching" message, not the error message.

@jpic
Copy link
Contributor

jpic commented Feb 15, 2017

Is this a duplicate of #4355 ?

@medmondson
Copy link

I'm on Chromium 56 using the "Loading remote data example":

Start by typing gal

1

Before the results are loaded type d. Error displays.

2

Wait a short period results show

3

@alexweissman
Copy link
Contributor

This should be fixed as of 4.0.6-rc.0.

@burnchar
Copy link

Confirmed fixed in 4.0.6-rc.1 (did not test rc.0). Thanks, Alex!

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

No branches or pull requests

5 participants