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

Multi select inputs with a total of 1.000 choices on one page freezes browser #599

Closed
marvinschroeder opened this issue Jun 3, 2019 · 2 comments · Fixed by #1170
Closed

Comments

@marvinschroeder
Copy link

marvinschroeder commented Jun 3, 2019

We were using two select inputs with "multiple" enabled on one page. Each input has around 500 option entries and approx. half of them were selected.

The first click ("focus") in the Choices inputs and the "blur" click were freezing the browser (Chrome/Safari/Firefox) for 2-4 seconds. The browsers were furthermore regulary freezing if we were trying to scroll without touching the input, but clicking on some other page content before (blur click).

The inputs:

<select class="choices-multiple-remove-button" name="example" multiple">...options...</select>

Have the following configuration:

new Choices('.choices-multiple-remove-button', {
                removeItemButton: true,
                position: 'bottom',
                renderChoiceLimit: 10,
                duplicateItemsAllowed: false,
});

Is there anything we can do to increase the performance?

EDIT: We tested this with only a few options entries selected (10%) and with around half of them (50%). The more option entries were selected, the longer and more were the freezes. So the amount of selected choices together with the focus/blur clicks were the performance killers. The debugger console confirms that: [Violation] 'click' handler took 3422ms

@martijnhartlief
Copy link

Probably related to #522

Xon added a commit to Xon/Choices.js that referenced this issue Aug 22, 2024
@Xon
Copy link
Collaborator

Xon commented Aug 22, 2024

This is "better" but isn't great with v11.0.0. The problem is down to just re-rendering too many items at once

@Xon Xon linked a pull request Aug 22, 2024 that will close this issue
3 tasks
Xon added a commit to Xon/Choices.js that referenced this issue Aug 25, 2024
@Xon Xon closed this as completed in #1170 Aug 27, 2024
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

Successfully merging a pull request may close this issue.

3 participants