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] Hover Styling Missing with Chakra >= 2.4.0 #219

Closed
4 of 6 tasks
justinforlenza opened this issue Nov 19, 2022 · 3 comments · Fixed by #220
Closed
4 of 6 tasks

[BUG] Hover Styling Missing with Chakra >= 2.4.0 #219

justinforlenza opened this issue Nov 19, 2022 · 3 comments · Fixed by #220
Assignees
Labels
Bug Something isn't working

Comments

@justinforlenza
Copy link

Description

When using chakra 2.4.0 or greater the hover styling for options is no longer visible in chakra-react-select

Chakra 2.4.1
image

Chakra 2.3.7
image

chakra-react-select Version

4.4.0

Link to Reproduction

https://codesandbox.io/s/chakra-react-select-missing-hover-style-584m52

TypeScript?

  • Yes I use TypeScript

Steps to reproduce

  1. Install Charka UI >= 2.4.0 & Chakra React Select
  2. Create select component
  3. hover over select option

Operating System

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

Additional Information

No response

@justinforlenza justinforlenza added the Bug Something isn't working label Nov 19, 2022
@kicks321
Copy link

@csandman, so we just started integrating this library into our frontend project.

We have two applications, both running 4.4.0. What's weird is one of them, hover styles works perfect. In the other, it doesn't at all.

@kicks321
Copy link

kicks321 commented Nov 23, 2022

@justinforlenza and @csandman, I was able to solve this problem using just a custom Chakra Style

    const chakraStyles: ChakraStylesConfig = {
        dropdownIndicator: (provided, state) => ({
            ...provided,
            background: state.isFocused ? 'blue.100' : provided.background,
            p: 0,
            w: '40px',
        }),
        placeholder: (provided, state) => ({
            ...provided,
            color: 'gray.500',
        }),
        option: (provided, state) => ({
            ...provided,
            _hover: {
                color: 'blue.500',
                bg: !state.isSelected && 'gray.100',
            },
        }),
    };

@csandman
Copy link
Owner

csandman commented Nov 28, 2022

Sorry for the late response on this, I've been on vacation for the past week. I published a new version (v4.4.1) with the fix from @tzii which appears to do the trick, but if there are any further issues feel free to reach out!

It appears this issue was caused by a change in the way Chakra UI styles their hovered/focused options in their Menu component, just so people are aware.

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.

3 participants