Eliminating text resizing

26/04/2016

Eliminate the possibility of completely resizing the texts.  Take out the “grippies” of Drupal just like the resizing of the html component.

PHP code:


/**
 * Implements hook_element_info_alter().
 */
function MYMODULE_element_info_alter(&$types) {
  $types['textarea']['#process'][] = 'MYMODULE_process_textarea';
}

/**
 * Custom process function to disable "grippies" on textareas.
 */
function MYMODULE_process_textarea($element) {
  $element['#resizable'] = FALSE;
  return $element;
}

CSS code:


textarea {
  resize: none;
}