Files
react-test/test/regressions/fixtures/Textarea/Textarea.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
import * as React from 'react';
import Input from '@mui/material/Input';
function Textarea() {
const [value, setValue] = React.useState(
`Hey, sorry for being late to respond. Here is a codesandbox. It actually happens when I reduce the font-size of the input. Try adding some text or paste a long paragraph and you will the bottom margin being increased. It works fine with the default font-size.`,
);
const handleChange = (event) => {
setValue(event.target.value);
};
return (
<div>
<Input
sx={{
width: 200,
'& .MuiInput-input': {
fontSize: 13,
boxSizing: 'border-box',
border: '10px solid black',
},
}}
multiline
value={value}
onChange={handleChange}
/>
<Input
sx={{
width: 200,
'& .MuiInput-input': { fontSize: 13, boxSizing: 'content-box', padding: '10px' },
}}
multiline
value={value}
onChange={handleChange}
/>
<Input style={{ width: 200 }} multiline placeholder="rows" rows={3} />
<Input style={{ width: 200 }} multiline value={value} onChange={handleChange} maxRows={4} />
<Input style={{ width: 200 }} multiline placeholder="long placeholder long placeholder" />
<Input
style={{ width: 200 }}
multiline
defaultValue="long default value long default value"
/>
</div>
);
}
export default Textarea;