Skip to content

Commit

Permalink
For long lines use helper text
Browse files Browse the repository at this point in the history
Long lables break the layout and it won't be fixed: mui/material-ui#12255, so for long labels we'll use helper text instead
  • Loading branch information
tzachshabtay committed Feb 9, 2020
1 parent 9bdc741 commit 43df7ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,21 @@ export default class Line extends React.Component {

render() {
let from = trimStart(this.props.from);
let label = from;
let helperText = "";
if (from && from.length > 200) {
label = "";
helperText = from;
}
let to = this.state.to ? trimStart(this.state.to) : "";
return (<Grid container alignItems="center" direction="row" spacing={0} style={{ marginTop: 5 }}>
<Grid item xs={1}>
<span>{this.props.index + 1}</span>
</Grid>
<Grid item xs={11}>
<TextField
label={from}
label={label}
helperText={helperText}
placeholder="Missing translation"
margin="normal"
fullWidth
Expand Down

0 comments on commit 43df7ba

Please sign in to comment.