Description
The item attribute "Submit when Enter Pressed" currently does not behave as expected when a page contains only a single input item.
Even when the attribute is set to No, pressing Enter in the item still submits the page because the browser's default form submission behavior takes precedence.
This makes it difficult to implement custom Enter-key handling (e.g. Dynamic Actions, JavaScript events, custom search functionality) and forces developers to add JavaScript workarounds such as preventDefault().
Expected behavior
When Submit when Enter Pressed = No is configured, APEX should reliably prevent page submission triggered by the Enter key, regardless of how many items exist on the page.
Current workarounds
Developers currently have to use workarounds such as:
- Adding custom JavaScript to intercept Enter and call
preventDefault()
- Creating a second dummy item and hiding it, only to prevent the browser from treating the page as a single-input form
Both workarounds are unintuitive and should not be necessary when a declarative attribute already exists.
Proposed enhancement
Ensure that Submit when Enter Pressed = No is fully respected, including on pages that contain only a single input item.
This would make the existing declarative setting behave consistently and eliminate the need for custom JavaScript in a common use case.