Case ce-0057 · Scenario scenario-maxlength-behavior

maxlength attribute is not supported on contenteditable

OS: Windows 11 Device: Desktop or Laptop Any Browser: Chrome 120.0 Keyboard: US Status: draft
maxlength validation chrome

Phenomenon

The maxlength attribute, which works on <input> and <textarea> elements, is not supported on contenteditable regions. There is no built-in way to limit the amount of content that can be entered.

Reproduction example

  1. Create a contenteditable div with maxlength="100".
  2. Try to type more than 100 characters.
  3. Observe whether the input is limited.

Observed behavior

  • In Chrome on Windows, the maxlength attribute is ignored on contenteditable.
  • Users can enter unlimited content.
  • No built-in validation or limitation exists.

Expected behavior

  • The maxlength attribute should be supported on contenteditable.
  • Input should be limited to the specified length.
  • Or, there should be a standard way to limit content length.

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 11
Device: Desktop or Laptop Any
Browser: Chrome 120.0
Keyboard: US
Your environment

Use this editable area to reproduce the described case.

Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.