Skip to content

Commit

Permalink
Merge pull request #1590 from okta/ee/read-only-input
Browse files Browse the repository at this point in the history
TextField: update :read-only and :disabled styles
  • Loading branch information
edburyenegren-okta authored Oct 5, 2022
2 parents 0231d18 + ccea01b commit 1724a5f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/odyssey-react-mui/src/themes/odyssey/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,13 @@ export const components: ThemeOptions["components"] = {
},
MuiInputBase: {
styleOverrides: {
root: {
root: ({ ownerState, theme }) => ({
lineHeight: "1.14285714",
},

...(ownerState.readOnly === true && {
backgroundColor: theme.palette.grey[50],
}),
}),
input: {
boxSizing: "border-box",
height: "auto",
Expand Down Expand Up @@ -674,10 +678,11 @@ export const components: ThemeOptions["components"] = {
[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]:
{
borderColor: theme.palette.action.disabled,
pointerEvents: "auto",
},
[`&.${outlinedInputClasses.disabled}`]: {
backgroundColor: theme.palette.grey[50],
pointerEvents: "none",
cursor: "not-allowed",
},
...(ownerState.startAdornment && {
paddingLeft: theme.spacing(3),
Expand Down

0 comments on commit 1724a5f

Please sign in to comment.