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

Wrong innerProps in MultiValueContainer since 5.7.0 #5834

Open
Dron007 opened this issue Dec 21, 2023 · 1 comment
Open

Wrong innerProps in MultiValueContainer since 5.7.0 #5834

Dron007 opened this issue Dec 21, 2023 · 1 comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@Dron007
Copy link

Dron007 commented Dec 21, 2023

After upgrading react-select from v5.6.1 to v5.8.0 I noticed that remove buttons in multiselect values are wrapped.
image
Here is the simplified code

import React from "react";
import Select from "react-select";

const optionsArray = [
  { value: "o1", label: "option 1" },
  { value: "o2", label: "option 2" },
];

const MultiValueContainer = (props) => {
  console.log("props:", props);
  // this one works
  // return <div style={{ ...props.innerProps?.css }}>{props.children}</div>;

  return <div {...props.innerProps}>{props.children}</div>;
};

export default () => (
  <Select
    isMulti
    components={{ MultiValueContainer: MultiValueContainer }}
    value={[{ value: "o1", label: "option 1" }]}
    options={optionsArray}
  />
);

Here is the sandbox: https://codesandbox.io/p/sandbox/codesandboxer-example-forked-k5mjlq
The breaking change was introduced somewhere here.

InnerProps had className in 5.6.1 but in 5.7.0 it has empty className and css object with styles which is ignored in my code. I can change the code as you may see in commented lines but I am not sure it is correct way. It is not documented.

@Dron007 Dron007 added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Dec 21, 2023
@Dron007
Copy link
Author

Dron007 commented Sep 11, 2024

Why is this issue marked as bug-unconfirmed? I added a sandbox example, it is easy to verify that it is still broken in the latest versions. We can add some workarounds in our code but I would prefer some fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

1 participant