Skip to content

Commit

Permalink
Standard input not loading correctly #39157 fixed issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NmN03jain committed Oct 1, 2023
1 parent b2ae353 commit 7794fc2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
38 changes: 14 additions & 24 deletions docs/data/material/components/text-fields/BasicTextFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,28 @@ import * as React from 'react';
import Box from '@mui/material/Box';
import TextField from '@mui/material/TextField';

const filledTextFieldStyles = {
'& .MuiFilledInput-root': {
backgroundColor: 'inherit',
},
};

const standardTextFieldStyles = {
'& .MuiInputBase-root': {
border: '1px solid #e0e0e0',
},
};

export default function BasicTextFields() {
return (
<Box
component="form"
sx={{
'& > :not(style)': { m: 1, width: '25ch' },
}}
noValidate
autoComplete="off"
>
<TextField id="outlined-basic" label="Outlined" variant="outlined" />
<TextField
id="filled-basic"
label="Filled"
variant="filled"
sx={{ // Add custom styles for the filled variant
'& .MuiFilledInput-root': {
backgroundColor: 'inherit', // Set the background color to inherit
},
}}
/>
<TextField
id="standard-basic"
label="Standard"
variant="standard"
sx={{ // Add custom styles for the standard variant
'& .MuiInputBase-root': {
border: '1px solid #e0e0e0', // Set the border for the standard variant
},
}}
/>
<TextField id="filled-basic" label="Filled" variant="filled" style={filledTextFieldStyles} />
<TextField id="standard-basic" label="Standard" variant="standard" style={standardTextFieldStyles} />
</Box>
);
}

19 changes: 14 additions & 5 deletions docs/data/material/components/text-fields/BasicTextFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@ import * as React from 'react';
import Box from '@mui/material/Box';
import TextField from '@mui/material/TextField';

const filledTextFieldStyles = {
'& .MuiFilledInput-root': {
backgroundColor: 'inherit',
},
};

const standardTextFieldStyles = {
'& .MuiInputBase-root': {
border: '1px solid #e0e0e0',
},
};

export default function BasicTextFields() {
return (
<Box
component="form"
sx={{
'& > :not(style)': { m: 1, width: '25ch' },
}}
noValidate
autoComplete="off"
>
<TextField id="outlined-basic" label="Outlined" variant="outlined" />
<TextField id="filled-basic" label="Filled" variant="filled" />
<TextField id="standard-basic" label="Standard" variant="standard" />
<TextField id="filled-basic" label="Filled" variant="filled" style={filledTextFieldStyles} />
<TextField id="standard-basic" label="Standard" variant="standard" style={standardTextFieldStyles} />
</Box>
);
}

0 comments on commit 7794fc2

Please sign in to comment.