diff --git a/docs/fields/textarea.mdx b/docs/fields/textarea.mdx index ac6a23f19b1..fae61edc11b 100644 --- a/docs/fields/textarea.mdx +++ b/docs/fields/textarea.mdx @@ -68,11 +68,12 @@ export const MyTextareaField: Field = { The Textarea Field inherits all of the default options from the base [Field Admin Config](../admin/fields#admin-options), plus the following additional options: -| Option | Description | -| -------------- | ---------------------------------------------------------------------------------------------------------------- | -| **`placeholder`** | Set this property to define a placeholder string in the textarea. | -| **`autoComplete`** | Set this property to a string that will be used for browser autocomplete. | -| **`rtl`** | Override the default text direction of the Admin Panel for this field. Set to `true` to force right-to-left text direction. | +| Option | Description | +| ------------------ | --------------------------------------------------------------------------------------------------------------------------- | +| **`placeholder`** | Set this property to define a placeholder string in the textarea. | +| **`autoComplete`** | Set this property to a string that will be used for browser autocomplete. | +| **`rows`** | Set the number of visible text rows in the textarea. Defaults to `2` if not specified. | +| **`rtl`** | Override the default text direction of the Admin Panel for this field. Set to `true` to force right-to-left text direction. | ## Example diff --git a/packages/ui/src/fields/Textarea/index.scss b/packages/ui/src/fields/Textarea/index.scss index 751fcaefb70..879efbe8cc8 100644 --- a/packages/ui/src/fields/Textarea/index.scss +++ b/packages/ui/src/fields/Textarea/index.scss @@ -40,9 +40,8 @@ // Unstyle the textarea, the border is rendered on .textarea-outer .textarea-element { - position: absolute; - top: 0; - left: 0; + position: relative; + z-index: 1; width: 100%; height: 100%; border: inherit; @@ -66,13 +65,17 @@ // Clone of textarea with same height .textarea-clone { - vertical-align: top; - display: inline-block; - flex-grow: 1; - overflow: hidden; - text-overflow: ellipsis; - white-space: pre-wrap; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; pointer-events: none; + white-space: pre-wrap; + overflow-wrap: break-word; + visibility: hidden; + z-index: 0; + line-height: inherit; } .textarea-clone::before {