function Textarea::preRenderAttachments

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Render/Element/Textarea.php \Drupal\Core\Render\Element\Textarea::preRenderAttachments()

Adds the textarea resize library.

File

core/lib/Drupal/Core/Render/Element/Textarea.php, line 57

Class

Textarea
Provides a form element for input of multiple-line text.

Namespace

Drupal\Core\Render\Element

Code

public static function preRenderAttachments($element) : array {
  $element['#attached']['library'][] = 'core/drupal.textarea-resize';
  return $element;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.