Phenomenon
The autofocus attribute, which automatically focuses form inputs on page load, does not work on contenteditable elements. There is no built-in way to automatically focus a contenteditable region when a page loads.
Reproduction example
- Create a contenteditable div with
autofocusattribute. - Load the page.
- Observe whether the contenteditable receives focus automatically.
Observed behavior
- In Chrome on Windows, the
autofocusattribute is ignored on contenteditable. - The contenteditable does not receive focus automatically.
- Manual JavaScript focus() call is required.
Expected behavior
- The
autofocusattribute should work on contenteditable. - Or, there should be a standard way to auto-focus contenteditable regions.
- Focus should be handled consistently with form inputs.