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

fix unhighlightAll performance issue #648

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

Tomakava
Copy link
Contributor

@Tomakava Tomakava commented Oct 2, 2019

Description

Due to an error in a condition, hasHighlightedItems variable is assigned an array and the condition below is always true. As a result, unhighlightAll is called each time, which updates items that need to be rendered again.

Motivation and Context

When using Formio.js with large number of select components performance issue was noticed.
For every click and keypress in any component items of all select components are rendered.

How Has This Been Tested?

Tested locally in Formio.js
After this fix unhighlightAll and _render are not called on every click

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jshjohnson
Copy link
Collaborator

Good spot! Thanks a lot 💯

@jshjohnson jshjohnson merged commit 37db45e into Choices-js:master Oct 3, 2019
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 this pull request may close these issues.

2 participants