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

[BUG] Group Heading props does not work #295

Closed
1 of 6 tasks
pdhruv93 opened this issue Oct 26, 2023 · 3 comments · Fixed by #296
Closed
1 of 6 tasks

[BUG] Group Heading props does not work #295

pdhruv93 opened this issue Oct 26, 2023 · 3 comments · Fixed by #296
Assignees
Labels
Bug Something isn't working

Comments

@pdhruv93
Copy link

pdhruv93 commented Oct 26, 2023

Description

I am using custom Group component but somehow the onClick does not work. It works on normal react-select. The end goal is to select all the options under a group when the heading is clicked. Here is the link for react-select

const Group = (props: any) => {
    const onClick = () => {
        console.log(':::Here');
        props.selectProps.onChange(props.options);
    };
    
    return (
        <chakraComponents.Group
            {...props}
            headingProps={{ ...props.headingProps, onClick }}
        />
    );
};
<Select
    {...props}
    isMulti
    formatGroupLabel={formatGroupLabel}
    chakraStyles={selectStyles}
    components={{ Group }}
    menuIsOpen
/>

chakra-react-select Version

4.7.5

Link to Reproduction

https://codesandbox.io/p/sandbox/chakra-accordion-react-seelct-vp6pcr

TypeScript?

  • Yes I use TypeScript

Steps to reproduce

Please check on the sandbox link provided

Operating System

  • macOS
  • Windows
  • Linux
  • iOS/iPadOS
  • Android

Additional Information

No response

@pdhruv93 pdhruv93 added the Bug Something isn't working label Oct 26, 2023
@csandman
Copy link
Owner

Yeah, I actually realized this was an issue very recently and had a fix in another branch I've been working on. I've been running into performance issues with that branch though, so I'm probably going to cherry pick some of the changes in it so I can get a release out sooner with some of the smaller changes. I'll try and get a fix out for this either later today or tomorrow!

@pdhruv93
Copy link
Author

Thanks, quite quick!

@csandman
Copy link
Owner

csandman commented Oct 27, 2023

Ok, a new version, v4.7.6, has been pushed out with a fix for this! I replicated your example that wasn't working and you can see that it is now working on this version: https://codesandbox.io/s/q36t83?file=/ChakraAccordion.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants