-
Notifications
You must be signed in to change notification settings - Fork 32
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]: colorScheme
doesn't get passed to input variants
#267
Comments
For extra context I'm referring to the global E.g. if it is used like this:
|
Hmm I see what you mean. I think this is due to a difference in the way I'm using color scheme from how you're expecting it to be. As per the docs:
This prop was originally added for the And on that note, what exactly are you trying to accomplish with this? What are you using the |
I've managed to make a work around using the `chakraStyles` props like this:
chakraStyles={{
control: (provided, _state) => ({
...provided,
borderColor: isMaterial ? `${colorScheme}.200` : undefined,
color: isMaterial ? `${colorScheme}.500` : undefined,
_hover: {
borderColor: isMaterial ? `${colorScheme}.300` : undefined,
},
}),
}}
It would be nice though to at least have something like `chakraColorScheme`
as a prop that would be passed down to that...
|
I was trying to achieve the same thing which is to change the background of the select input. I have a grey background which if I don't set the select background is grey like the "Operator" select but I want it to be white like the "Variable" select which I added a wrapping @barrymichaeldoyle solution works well though |
As of |
that would be nice if i could control the color of the outline (border color) on the field. |
This is already currently possible using the Fair warning though, it appears that they are removing these theme props from Chakra v3, so if you plan to upgrade to that at some point, expect that these props will probably be removed in favor of a more custom implementation. |
Description
When I pass
colorScheme
to theSelect
component. I expect to be able to use in my theme file. But thecolorScheme
comes back asundefined
.If I copy exactly what it here:
https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/theme/src/components/input.ts
Let's console.log the
colorScheme
invariantOutline
.When I do this for a normal
Input
it correctly shows the colorScheme that I passed to my component. This works for other libs that use Chakra's input under the hood too.But with this library it returns undefined.
chakra-react-select Version
4.6.0
Link to Reproduction
No response
TypeScript?
Steps to reproduce
No response
Operating System
Additional Information
I think it's just getting cleared somewhere. I tried to dig through the codebase to find it but everything is pretty much abstracted away.
The text was updated successfully, but these errors were encountered: