Skip to content

Commit

Permalink
fix(select-utils): fix disabled option appearance of select-inputs (#…
Browse files Browse the repository at this point in the history
…2825)

Co-authored-by: Carlos Cortizas <[email protected]>
  • Loading branch information
misama-ct and CarlosCortizasCT authored May 24, 2024
1 parent 95318cb commit 3036c24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-kings-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-uikit/select-utils': patch
---

fixes the appearance of disabled options (text-color & :active background) in select-inputs
Original file line number Diff line number Diff line change
Expand Up @@ -322,23 +322,20 @@ const optionStyles = (props: TProps) => (base: TBase, state: TState) => {
: designTokens.fontSize30,
cursor: state.isDisabled ? 'not-allowed' : 'pointer',
color: (() => {
if (!state.isDisabled) return designTokens.fontColorForInput;
if (state.isSelected) return designTokens.fontColorForInput;
return base.color;
if (state.isDisabled) return designTokens.fontColorForInputWhenDisabled;
return designTokens.fontColorForInput;
})(),
backgroundColor: (() => {
if (state.isSelected) return designTokens.colorPrimary95;
if (state.isFocused)
return designTokens.backgroundColorForInputWhenHovered;
return base.backgroundColor;
})(),

'&:active': {
color: (() => {
if (!state.isDisabled) return designTokens.fontColorForInput;
return base.color;
backgroundColor: (() => {
if (state.isDisabled) return designTokens.colorTransparent;
return designTokens.colorPrimary95;
})(),
backgroundColor: designTokens.colorPrimary95,
},
};
};
Expand Down

0 comments on commit 3036c24

Please sign in to comment.