React-admin: Support fullWidth for labelled fields using addLabel

Created on 20 Jun 2018  路  1Comment  路  Source: marmelab/react-admin

What you were expecting:
I would like to apply 'fullWidth' on the label in show view.

What happened instead:
My label have a min width and my component take it.

Steps to reproduce:

field.field.defaultProps = {
                addLabel: true,
                fullWidth: true
            };
export const YamlField = ({ source, record = {} }) => (
    <AceEditor
        width="100%"
        mode="yaml"
        theme="monokai"
        showPrintMargin={false}
        showGutter={true}
        highlightActiveLine={true}
        setOptions={{
            showLineNumbers: true,
            tabSize: 2
        }}
        editorProps={{ $blockScrolling: Infinity }}
        value={record[source]}
        readOnly={true}
    />
);

Environment

  • React-admin version: 2.0.2
  • Last version that did not exhibit the issue (if applicable):
  • React version: 16.3.0
  • Browser: chrome

>All comments

Then don't use addLabel but decorate your component with the <Labeled> component, or better, use material-ui's FormControl and InputLabel directly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yangjiamu picture yangjiamu  路  3Comments

pixelscripter picture pixelscripter  路  3Comments

kdabir picture kdabir  路  3Comments

alukito picture alukito  路  3Comments

9747749366 picture 9747749366  路  3Comments