{% extends "forms/field.html.twig" %}

{% block input %}
    <div class="{{ form_field_wrapper_classes ?: 'form-textarea-wrapper' }} {{ field.size }} {{ field.wrapper_classes }}">
        <textarea
            {# required attribute structures #}
            name="{{ (scope ~ field.name)|fieldName }}"
            {# input attribute structures #}
            {% block input_attributes %}
                class="{{ form_field_textarea_classes }} {{ field.classes }}"
                {% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
                {% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
                {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
                {% if field.placeholder %}placeholder="{{ field.placeholder|t }}"{% endif %}
                {% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
                {% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
                {% if field.readonly in ['on', 'true', 1] %}readonly="readonly"{% endif %}
                {% if field.autocomplete in ['on', 'off'] %}autocomplete="{{ field.autocomplete }}"{% endif %}
                {% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
                {% if field.validate.pattern %}pattern="{{ field.validate.pattern }}"{% endif %}
                {% if field.validate.message %}title="{% if grav.twig.twig.filters['tu'] is defined %}{{ field.validate.message|tu|e }}{% else %}{{ field.validate.message|t|e }}{% endif %}"{% endif %}
                {% if field.rows is defined %}rows="{{ field.rows }}"{% endif %}
                {% if field.cols is defined %}cols="{{ field.cols }}"{% endif %}
            {% endblock %}
            >{{ value|trim|e('html') }}</textarea>
    </div>
{% endblock %}
