Skip to content

Make counter fields directly writable in wizards - #822

Merged
rzueger merged 1 commit into
developfrom
writable-counter-fields
Jul 8, 2026
Merged

Make counter fields directly writable in wizards#822
rzueger merged 1 commit into
developfrom
writable-counter-fields

Conversation

@rzueger

@rzueger rzueger commented Jul 8, 2026

Copy link
Copy Markdown
Member

Problem

In the movement wizard forms, the passenger counter (and the landing /
go-around counters, which share the same component) could only be
adjusted with the +/- buttons. Entering a large value — e.g. 17
passengers — meant clicking + seventeen times.

Change

The shared IncrementationField now renders a text input alongside the
+/- buttons, so the value can be typed directly — mirroring how the
time fields already work.

  • Digit-only input (/^\d*$/); non-digits and - are rejected as you
    type, so negative values are impossible.
  • The typed value is committed on blur and clamped to minValue
    (default 0); an empty field resolves to minValue.
  • The +/- buttons and the onChange({ target: { value } }) contract
    are unchanged, so the landing/go-around fee recomputation keeps working.

Because the component is shared, passenger, landing and go-around
counters all become writable.

Verification

  • npm run typecheck clean; full Jest suite passes (2281 tests).
  • Extended IncrementationField.spec.tsx: typing → commit on blur,
    clear → minValue, clamp below minValue, non-digit rejection, buttons
    unchanged.
  • npm run build --project=lszm compiles.

The passenger, landing and go-around counters were adjustable only via
the +/- buttons. Setting a large count meant many clicks. The shared
IncrementationField now renders a digit-only text input as well, so a
value can be typed directly, mirroring the time field. The typed value
is committed and clamped to minValue on blur; the +/- buttons and the
onChange contract are unchanged.
@rzueger
rzueger merged commit 3fd74f8 into develop Jul 8, 2026
2 checks passed
@rzueger
rzueger deleted the writable-counter-fields branch July 8, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant