React-admin: multiline TextField

Created on 9 Oct 2018  路  3Comments  路  Source: marmelab/react-admin

If a record was created using LongTextInput it can contain multiline plain text (no HTML).

In the show view I find no satisfactory way to show this multiline plain text.

TextField uses Typography and it looks like it doesn't support multiline, so if I'm not mistaken we can either create another component or change the TextField implementation.

enhancement good first issue

Most helpful comment

Confirmed. We need a LongTextField which would display its content inside a <pre> tag. This can probably be achieved using the component prop of the Typography component

All 3 comments

Confirmed. We need a LongTextField which would display its content inside a <pre> tag. This can probably be achieved using the component prop of the Typography component

As the TextField component passes all its props to the underlying Typography, you can achieve this with:

<TextField component="pre" />.

LongTextInput is deprecated as the same logic applies (you can pass a multiline prop), so we won't add a new field either

Was this page helpful?
0 / 5 - 0 ratings