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

MultiSelect className repeatedly added #4048

Closed
justinbhopper opened this issue Apr 8, 2020 · 0 comments · Fixed by #4051
Closed

MultiSelect className repeatedly added #4048

justinbhopper opened this issue Apr 8, 2020 · 0 comments · Fixed by #4051

Comments

@justinbhopper
Copy link
Contributor

justinbhopper commented Apr 8, 2020

Environment

  • Package version(s): @blueprintjs/select 3.12.0
  • Browser and OS versions: Any

Sandbox illustrating bug is here

Steps to reproduce

  1. Create a MultiSelect with tagInputProps.inputProps specified.
  2. Focus into the input so that the popover opens.
  3. Observe the classnames of the input repeat.

Actual behavior

Classname "bp3-multi-select-tag-input-input" gets repeatedly added to the input.

image

Expected behavior

Classname "bp3-multi-select-tag-input-input" only gets added once.

Possible solution

This line is the culprit:
https://github.com/palantir/blueprint/blob/develop/packages/select/src/components/select/multiSelect.tsx#L123

Apparently classNames() does not do a comparison of existing classnames when appending the new class to the list. The current code is modifying the existing inputProps, and so this code running multiple times repeatedly adding the classname over and over. I believe this classname has only recently been added, as I did not observe this in version select/3.10.0 (nor did the classname seem to exist back then).

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

Successfully merging a pull request may close this issue.

2 participants