Case ce-0073 · Scenario scenario-entermode-behavior

enterkeyhint and inputmode affect Enter key behavior inconsistently

OS: iOS 17.0 Device: iPhone Any Browser: Safari 17.0 Keyboard: US Status: draft
enterkeyhint inputmode mobile ios safari

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

  1. Create a contenteditable div with inputmode="search" and enterkeyhint="search".
  2. On an iOS device, focus the contenteditable.
  3. Press the Enter key.
  4. 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.
  • enterkeyhint should control the action, not just the label.
  • Behavior should be consistent with standard input elements.

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: iOS 17.0
Device: iPhone Any
Browser: Safari 17.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.