Phenomenon
The autocorrect attribute, which controls automatic text correction on mobile keyboards, behaves differently on contenteditable elements compared to standard input elements. The correction suggestions may interfere with editing.
Reproduction example
- Create a contenteditable div with
autocorrect="on"orautocorrect="off". - On an iOS device, focus the contenteditable.
- Type text with intentional misspellings.
- Observe autocorrect behavior and compare with standard inputs.
Observed behavior
- In Safari on iOS,
autocorrectmay not respect the attribute value on contenteditable. - Autocorrect suggestions may appear even when
autocorrect="off". - Behavior may differ from standard input elements.
Expected behavior
autocorrectshould work identically on contenteditable and standard inputs.- The attribute value should be respected.
- Autocorrect should not interfere with IME composition.