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

Are you sure turns Chosen Plugin slow #76

Open
rafam31 opened this issue Feb 26, 2015 · 3 comments
Open

Are you sure turns Chosen Plugin slow #76

rafam31 opened this issue Feb 26, 2015 · 3 comments

Comments

@rafam31
Copy link

rafam31 commented Feb 26, 2015

I realized my large select (with Chosen) get very slow when i was using AreYouSure...

So, first i thought the problem was in chosen.. but, wasn't..

The problem were here: https://github.com/codedance/jquery.AreYouSure/blob/master/jquery.are-you-sure.js#L53-L57

I think this loop $.each is unnecessary, and i changed these lines to:

val += $field.find('option:selected').val();

Apparently, everthing works fine. So, i suggest this change, if possible.

@codedance
Copy link
Owner

Out of interest, how long is the list?

I'll need to go back through the code history. There is a bit of history to this section of code:

  1. The first implementation was done using string concat on selected options.
  2. The 2nd implementation used .val() on the selector. We then ended up having a few bug requests filed. From memory around multi-select cases in some browsers.
  3. Then it was reverted back to the old method.

If it is a considerable performance issue, it might be worth digging through the issue history and seeing how we can phase in without the regression.

@codedance
Copy link
Owner

Related:

The revert: #55

#49
#29
#48

Thougt's welcome :-)

@chekm8
Copy link

chekm8 commented Apr 2, 2015

Had the same issue with huge selects and implemented the change per rafam31. Worked great. Thanks!

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

3 participants