country input black text when option focused

This commit is contained in:
Sendou
2020-03-13 14:32:57 +02:00
parent 224ca5fbd7
commit a63dfed09e

View File

@@ -89,6 +89,12 @@ const Select: React.FC<SelectProps> = ({
return value
}
const getOptionColor = (focused: boolean) => {
if (focused) return "black"
return colorMode === "light" ? "black" : "white"
}
return (
<Box>
{label && <Label required={required}>{label}</Label>}
@@ -150,6 +156,13 @@ const Select: React.FC<SelectProps> = ({
background: themeColorHexLighter,
color: "black",
}),
option: (styles, { data, isDisabled, isFocused, isSelected }) => {
return {
...styles,
backgroundColor: isFocused ? themeColorHexLighter : undefined,
color: getOptionColor(isFocused),
}
},
}}
/>
</Box>