Skip to content

Commit d6f84e5

Browse files
committed
Merge remote-tracking branch 'origin' into v5
2 parents 42a0517 + b49461f commit d6f84e5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/chakra-components/menu.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export const Option = <
405405
selectedOptionStyle === "check" &&
406406
(!isMulti || hideSelectedOptions === false);
407407

408-
const shouldHighlight = selectedOptionStyle === "color";
408+
const shouldHighlight = selectedOptionStyle === "color" && isSelected;
409409

410410
const initialSx: SystemStyleObject = {
411411
...menuItemStyles,
@@ -417,13 +417,13 @@ export const Option = <
417417
fontSize: size,
418418
paddingX: horizontalPaddingOptions[size],
419419
paddingY: verticalPaddingOptions[size],
420-
...(shouldHighlight && {
421-
_selected: {
422-
bg: selectedBg,
423-
color: selectedColor,
424-
_active: { bg: selectedBg },
425-
},
426-
}),
420+
...(shouldHighlight
421+
? {
422+
bg: selectedBg,
423+
color: selectedColor,
424+
_active: { bg: selectedBg },
425+
}
426+
: {}),
427427
};
428428

429429
const sx = chakraStyles?.option

0 commit comments

Comments
 (0)