diff --git a/resources/js/components/fieldtypes/TextareaFieldtype.vue b/resources/js/components/fieldtypes/TextareaFieldtype.vue index f3b28678e83..59b2f0b3663 100644 --- a/resources/js/components/fieldtypes/TextareaFieldtype.vue +++ b/resources/js/components/fieldtypes/TextareaFieldtype.vue @@ -8,6 +8,7 @@ :placeholder="__(config.placeholder)" :model-value="value" :dir="contentDirection" + :rows="config.rows || 3" @blur="$emit('blur')" @focus="$emit('focus')" @update:model-value="updateDebounced" diff --git a/src/Fieldtypes/Textarea.php b/src/Fieldtypes/Textarea.php index c6abfeb5704..f6408303918 100644 --- a/src/Fieldtypes/Textarea.php +++ b/src/Fieldtypes/Textarea.php @@ -30,6 +30,13 @@ protected function configFieldItems(): array 'type' => 'integer', 'width' => 50, ], + 'rows' => [ + 'display' => ['Rows'], + 'instructions' => __('statamic::fieldtypes.text.config.rows'), + 'type' => 'integer', + 'width' => 50, + 'default' => 3, + ], ], ], [ diff --git a/tests/Fields/BlueprintTest.php b/tests/Fields/BlueprintTest.php index e9e4232f41c..801603f2fa7 100644 --- a/tests/Fields/BlueprintTest.php +++ b/tests/Fields/BlueprintTest.php @@ -492,6 +492,7 @@ public function converts_to_array_suitable_for_rendering_fields_in_publish_compo 'type' => 'textarea', 'placeholder' => null, 'character_limit' => null, + 'rows' => 3, 'default' => null, 'antlers' => false, 'component' => 'textarea', diff --git a/tests/Fields/FieldsTest.php b/tests/Fields/FieldsTest.php index 5375cd34dd7..82e6efedc3d 100644 --- a/tests/Fields/FieldsTest.php +++ b/tests/Fields/FieldsTest.php @@ -457,6 +457,7 @@ public function converts_to_array_suitable_for_rendering_fields_in_publish_compo 'replicator_preview' => true, 'duplicate' => true, 'actions' => true, + 'rows' => 3, ], ], $fields->toPublishArray()); } diff --git a/tests/Fields/SectionTest.php b/tests/Fields/SectionTest.php index cc9437a7bc6..06d06f14545 100644 --- a/tests/Fields/SectionTest.php +++ b/tests/Fields/SectionTest.php @@ -156,6 +156,7 @@ public function converts_to_array_suitable_for_rendering_fields_in_publish_compo 'type' => 'textarea', 'placeholder' => null, 'character_limit' => null, + 'rows' => 3, 'default' => null, 'antlers' => false, 'component' => 'textarea', diff --git a/tests/Fields/TabTest.php b/tests/Fields/TabTest.php index 11b4d4e0d63..5be98d5e6cc 100644 --- a/tests/Fields/TabTest.php +++ b/tests/Fields/TabTest.php @@ -183,6 +183,7 @@ public function converts_to_array_suitable_for_rendering_fields_in_publish_compo 'type' => 'textarea', 'placeholder' => null, 'character_limit' => null, + 'rows' => 3, 'default' => null, 'antlers' => false, 'component' => 'textarea',