Skip to content

Commit

Permalink
Merge pull request #28 from csandman/fix-input-styles
Browse files Browse the repository at this point in the history
Fix input styles
  • Loading branch information
csandman committed Jan 7, 2022
2 parents 19c54b9 + de2b21a commit f2f2c72
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chakra-react-select",
"version": "2.0.0",
"version": "2.0.1",
"description": "A chakra-ui wrapper for the popular select library react-select",
"license": "MIT",
"author": "Chris Sandvik <chris.sandvik@gmail.com>",
Expand Down
11 changes: 1 addition & 10 deletions src/chakra-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -954,16 +954,7 @@ const chakraComponents: ChakraSelectProps["components"] = {
</Box>
);
},
Input: (props) => (
<chakra.input
as={selectComponents.Input}
__css={{
color: "inherit",
lineHeight: 1,
}}
{...props}
/>
),
Input: (props) => <chakra.input as={selectComponents.Input} {...props} />,
};

export default chakraComponents;
10 changes: 10 additions & 0 deletions src/chakra-react-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ import {
TagVariant,
} from "./types";

// Custom styles for components which do not have a chakra equivalent
const customStyles: ChakraSelectProps["styles"] = {
input: (provided) => ({
...provided,
color: "inherit",
lineHeight: 1,
}),
};

const ChakraReactSelect = ({
children,
styles,
Expand Down Expand Up @@ -89,6 +98,7 @@ const ChakraReactSelect = ({
inputId: inputId || inputProps.id,
hasStickyGroupHeaders,
placeholderColor,
styles: customStyles,
chakraStyles,
focusBorderColor,
errorBorderColor,
Expand Down

0 comments on commit f2f2c72

Please sign in to comment.