Setting #resizable on a textarea has no effect

Created on 19 August 2016, about 8 years ago
Updated 30 April 2024, 4 months ago

Problem/Motivation

Setting #resizable on a form element with #type => textarea has no effect.

According to the API docs https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21... setting the value to 'none' should disable the resizing. It does not.

Additionally, the default setting of "vertical" similarly has no effect - the area is sizable horizontally by default.

Tested in Chrome and Firefox.

Steps to reproduce

1. Install vanilla Drupal 11.
2. Create a custom form with a textarea (use Drush to quickly generate one with a textarea field as default).
3. Set #resizable => 'none' for the form.
4. Observe form is resiable when viewing it.

Proposed resolution

Possible resolutions:
1. In textarea.html.twig in core/modules/system/templates, add resizble attribute to the textarea and for value take the passed in value to the template.
2. Try settings the resizable attribute as a class on the textarea.

Remaining tasks

NA

User interface changes

Resizable property will behave as expected for textareas.

API changes

NA

Data model changes

NA

Release notes snippet

NA

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Form 

Last updated 1 minute ago

Created by

🇺🇸United States dfletcher

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024