fix(client): pressing Enter on form fields doesn't submit #255

Closed
opened 2026-06-23 16:13:32 +00:00 by james · 0 comments
Owner

Context

On the universal client's /login screen, pressing Enter while focused on the password (or email) field does not trigger the form's submit. The user has to tap / click the "Sign in" button. Standard browser + native form behaviour expects Enter-on-last-field to submit.

The screen uses RN's <TextInput> directly, which doesn't wire keyboard-Enter to a parent form on its own — neither on RN Web nor native. The fix is to pass onSubmitEditing={onSubmit} to the password input (and probably returnKeyType="go" / blurOnSubmit={true} for native keyboards). The email input can pass onSubmitEditing={() => passwordRef.current?.focus()} to chain the focus.

Affected screens beyond /login — anywhere with a multi-field submit form:

  • /register
  • /server-setup
  • The PAT create form on /(app)/account
  • The contact-add row on /(app)/profile
  • The note-create form on /(app)/notes
  • The various Jobs / Education / Contracts edit forms on /(app)/experience

Source

User-reported (June 2026).

Scope

For each form-bearing screen / sub-form:

  • Wire onSubmitEditing on the last field to call the submit handler.
  • Wire onSubmitEditing on prior fields to focus the next field via a useRef<TextInput>.
  • Set returnKeyType="next" on non-terminal fields and returnKeyType="go" (or "done") on the terminal one.
  • Set blurOnSubmit consistently so the keyboard collapses on submit.

Single-field forms (e.g. "Add section" on Skills) just need onSubmitEditing={submit} and returnKeyType="done".

Acceptance criteria

  • Enter on the last field of every form submits.
  • Enter on a non-terminal field advances focus to the next field.
  • Web (PWA): browser's native form-submit-on-Enter behaviour either works or is replaced by the explicit wiring (don't break the existing path).
  • No new deps.
  • Manual smoke on Android via Expo Go: log in by typing email → next → typing password → enter.

Out of scope

  • Sweeping every TextInput across the app — only multi-field submit forms.
  • Replacing TextInput with a Formik / react-hook-form abstraction — the current per-screen useState setup stays.

Composes with

  • #176 — universal client.
  • The keyboard-avoidance ticket (filed alongside) — same surface, same screens, can land in either order.
## Context On the universal client's `/login` screen, pressing Enter while focused on the password (or email) field does not trigger the form's submit. The user has to tap / click the "Sign in" button. Standard browser + native form behaviour expects Enter-on-last-field to submit. The screen uses RN's `<TextInput>` directly, which doesn't wire keyboard-Enter to a parent form on its own — neither on RN Web nor native. The fix is to pass `onSubmitEditing={onSubmit}` to the password input (and probably `returnKeyType="go"` / `blurOnSubmit={true}` for native keyboards). The email input can pass `onSubmitEditing={() => passwordRef.current?.focus()}` to chain the focus. Affected screens beyond `/login` — anywhere with a multi-field submit form: - `/register` - `/server-setup` - The PAT create form on `/(app)/account` - The contact-add row on `/(app)/profile` - The note-create form on `/(app)/notes` - The various Jobs / Education / Contracts edit forms on `/(app)/experience` ## Source User-reported (June 2026). ## Scope For each form-bearing screen / sub-form: - Wire `onSubmitEditing` on the last field to call the submit handler. - Wire `onSubmitEditing` on prior fields to focus the next field via a `useRef<TextInput>`. - Set `returnKeyType="next"` on non-terminal fields and `returnKeyType="go"` (or `"done"`) on the terminal one. - Set `blurOnSubmit` consistently so the keyboard collapses on submit. Single-field forms (e.g. "Add section" on Skills) just need `onSubmitEditing={submit}` and `returnKeyType="done"`. ## Acceptance criteria - [ ] Enter on the last field of every form submits. - [ ] Enter on a non-terminal field advances focus to the next field. - [ ] Web (PWA): browser's native form-submit-on-Enter behaviour either works or is replaced by the explicit wiring (don't break the existing path). - [ ] No new deps. - [ ] Manual smoke on Android via Expo Go: log in by typing email → next → typing password → enter. ## Out of scope - Sweeping every TextInput across the app — only multi-field submit forms. - Replacing TextInput with a Formik / react-hook-form abstraction — the current per-screen useState setup stays. ## Composes with - [#176](https://forge.wynning.tech/james/carol/issues/176) — universal client. - The keyboard-avoidance ticket (filed alongside) — same surface, same screens, can land in either order.
james closed this issue 2026-06-23 16:51:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#255
No description provided.