Page tree
Skip to end of metadata
Go to start of metadata

The expanding text field is provided by the Content Editor module, which is an EE Pro module.

The ExpandingTextFieldDefinition is similar to the placeholder text field and provides an additional property named maxRows. (Note that this field indirectly extends the text field, which has the rows property.)

As the name of the field suggests, the field's vertical size expands proportionally with the increasing amount of the text entered, until it reaches the value of the maxRows property at which point a scroll bar will appear.

class: info.magnolia.editor.app.field.ExpandingTextFieldDefinition

The expanding text field is useful in the apps based on the Content editor such as the Stories app:


Before selecting the field


Selected


With the initial number of rows


With the maximum number of rows


With a scroll bar


The field can also be used in a dialog for a component:

It works in exactly the same way as in a Content editor app. (Not showing all states here.)

Field definition

authorBio:
  class: info.magnolia.editor.app.field.ExpandingTextFieldDefinition
  rows: 2
  maxRows: 5
#  label: Author biography
#  placeholder: Provide some info about the author ...


Node name

Value

 fields


 authorBio


 class

info.magnolia.editor.app.field.ExpandingTextFieldDefinition

 rows

2

 maxRows

5


You can use the placeholder text field properties and the maxRows property in the field's definition:

<field name>The name of field.

maxRows

optional, default is 10

The maximum number of rows to which the field may expand before showing a scroll bar.

rows

optional , default is 1

The number of text rows for the initial state of the field.

This property is defined in TextFieldDefinition .

You should provide translations for the placeholder and label properties. (Make use of the auto-generated 18n keys and provide the translations in a message bundle.)