Skip to content

Commit

Permalink
simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Sep 12, 2022
1 parent d88b379 commit ed040c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/mui-joy/src/Input/Input.tsx
Expand Up @@ -114,13 +114,12 @@ const InputRoot = styled('div', {
backgroundColor: variantStyle?.backgroundColor ?? theme.vars.palette.background.surface,
[`&:hover:not(.${inputClasses.focused})`]: {
...theme.variants[`${ownerState.variant!}Hover`]?.[ownerState.color!],
backgroundColor: variantStyle?.backgroundColor,
backgroundColor: null, // it is not common to change background on hover for Input
cursor: 'text',
},
[`&.${inputClasses.disabled}`]:
theme.variants[`${ownerState.variant!}Disabled`]?.[ownerState.color!],
[`&.${inputClasses.focused}`]: {
backgroundColor: variantStyle?.backgroundColor,
'&:before': {
boxShadow: `inset 0 0 0 var(--Input-focusedThickness) var(--Input-focusedHighlight)`,
},
Expand Down
3 changes: 1 addition & 2 deletions packages/mui-joy/src/Textarea/Textarea.tsx
Expand Up @@ -115,13 +115,12 @@ const TextareaRoot = styled('div', {
backgroundColor: variantStyle?.backgroundColor ?? theme.vars.palette.background.surface,
[`&:hover:not(.${textareaClasses.focused})`]: {
...theme.variants[`${ownerState.variant!}Hover`]?.[ownerState.color!],
backgroundColor: variantStyle?.backgroundColor,
backgroundColor: null, // it is not common to change background on hover for Input
cursor: 'text',
},
[`&.${textareaClasses.disabled}`]:
theme.variants[`${ownerState.variant!}Disabled`]?.[ownerState.color!],
[`&.${textareaClasses.focused}`]: {
backgroundColor: variantStyle?.backgroundColor,
'&:before': {
boxShadow: `inset 0 0 0 var(--Textarea-focusedThickness) var(--Textarea-focusedHighlight)`,
},
Expand Down

0 comments on commit ed040c4

Please sign in to comment.