Phenomenon
On mobile devices, the combination of enterkeyhint and inputmode attributes may affect Enter key behavior inconsistently on contenteditable elements. The Enter key may insert line breaks when it should perform an action, or vice versa.
Reproduction example
- Create a contenteditable div with
inputmode="search"andenterkeyhint="search". - On an iOS device, focus the contenteditable.
- Press the Enter key.
- Observe whether it inserts a line break or triggers a search action.
Observed behavior
- In Safari on iOS, Enter key behavior may not match the attribute values.
- Line breaks may be inserted even when an action is expected.
- The behavior may differ from standard input elements.
Expected behavior
- Enter key behavior should match the attribute values.
enterkeyhintshould control the action, not just the label.- Behavior should be consistent with standard input elements.