Phenomenon
The autocapitalize attribute, which controls automatic capitalization on mobile keyboards, works inconsistently on contenteditable elements. The behavior may differ from standard input elements.
Reproduction example
- Create a contenteditable div with
autocapitalize="sentences". - On an iOS device, focus the contenteditable.
- Type text and observe capitalization behavior.
- Compare with a standard input element with the same attribute.
Observed behavior
- In Safari on iOS,
autocapitalizemay not work as expected on contenteditable. - Capitalization behavior may differ from standard inputs.
- The attribute may be ignored in some cases.
Expected behavior
autocapitalizeshould work identically on contenteditable and standard inputs.- Capitalization should follow the specified mode (sentences, words, characters, none).
- Behavior should be consistent across browsers and devices.