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

ComboBox: Move filtered options out of state #162

Closed
jpuri opened this issue Aug 3, 2015 · 1 comment
Closed

ComboBox: Move filtered options out of state #162

jpuri opened this issue Aug 3, 2015 · 1 comment
Assignees

Comments

@jpuri
Copy link
Collaborator

jpuri commented Aug 3, 2015

FilteredOptions in ComboBox are derived from other state variables and should not be part of state. Also its creating this issue reported by @bvleur :

"If you arrive at a input value matching an option by pressing backspace, the isMatchingOption won't be set to true."

@jpuri
Copy link
Collaborator Author

jpuri commented Aug 3, 2015

Fix:
I do not wanted to move logic for calculation of filtered option in render method as that calculation may not be needed each time combobox is rendered. I have rather moved it to a variable (instance variable) of ComboBox, so that we calculate it only when:

  1. Component is initialized or receives props.
  2. Value of component changes.

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

2 participants