diff --git a/package-lock.json b/package-lock.json index a9e723e..be3877c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "4.10.0", "license": "MIT", "dependencies": { - "react-select": "5.8.1" + "react-select": "5.8.x" }, "devDependencies": { "@arethetypeswrong/cli": "^0.16.4", diff --git a/package.json b/package.json index 40d7f23..246718b 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "start": "nodemon --watch src --exec npm run build -e ts,tsx" }, "dependencies": { - "react-select": "5.8.1" + "react-select": "5.8.x" }, "peerDependencies": { "@chakra-ui/react": "2.x", diff --git a/src/chakra-components/menu.tsx b/src/chakra-components/menu.tsx index 014a5ca..a6fff33 100644 --- a/src/chakra-components/menu.tsx +++ b/src/chakra-components/menu.tsx @@ -411,7 +411,7 @@ export const Option = < selectedOptionStyle === "check" && (!isMulti || hideSelectedOptions === false); - const shouldHighlight = selectedOptionStyle === "color"; + const shouldHighlight = selectedOptionStyle === "color" && isSelected; const initialSx: SystemStyleObject = { ...menuItemStyles, @@ -423,13 +423,13 @@ export const Option = < fontSize: size, paddingX: horizontalPaddingOptions[size], paddingY: verticalPaddingOptions[size], - ...(shouldHighlight && { - _selected: { - bg: selectedBg, - color: selectedColor, - _active: { bg: selectedBg }, - }, - }), + ...(shouldHighlight + ? { + bg: selectedBg, + color: selectedColor, + _active: { bg: selectedBg }, + } + : {}), }; const sx = chakraStyles?.option