Add maxlength html attribute to textarea

Created on 10 July 2023, over 1 year ago

Problem/Motivation

  • Maxlength was not supported in older browsers prior to some version of the html spec
  • It is now supported by Drupal Core Form API https://www.drupal.org/node/2887280 and all modern browsers
  • Can this module support adding the maxlength attribute to the form element in addition to the JS maxlength? Perhaps only if 'Enforce' is checked

Steps to reproduce

Set a maxlength on a textarea
Maxlength is applied via JS only, no maxlength attribute added to textarea input

Proposed resolution

Add maxlength to textarea when Enforce maximum length is set to true

Remaining tasks

  • ❌Get maintainer approval for the proposed resolution
  • ❌Implement resolution
  • ❌Write test coverage (contact a maintainer if you need help)
  • ❌Maintainer review via the UI
  • ❌Maintainer Code Review #1
  • ❌Maintainer code review #2
  • ❌Merge into dev branch, with credit to author and participants

User interface changes

Browser maxlength will block input

API changes

None

Data model changes

None

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇬🇧United Kingdom scott_euser

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024