Skip to content

feat(forms): add FormField wrapper, keyboard-only focus ring, and DateInput for date of birth#167

Open
stacelKonrad wants to merge 3 commits into
mainfrom
62-feat-text-input-component
Open

feat(forms): add FormField wrapper, keyboard-only focus ring, and DateInput for date of birth#167
stacelKonrad wants to merge 3 commits into
mainfrom
62-feat-text-input-component

Conversation

@stacelKonrad

Copy link
Copy Markdown
Collaborator
  • Extract FormField component that encapsulates Controller + Field + FieldError and pre-computes validationState, eliminating ~25 repetitive ternaries across 8 form files
  • Replace TextInput type="date" with DateInput (IMask masked input) to fix broken native date picker on Safari
  • Add keyboard-only focus ring to TextInput using pointer tracking — ring appears on Tab navigation but not on mouse click

…eInput for date of birth

- Extract FormField component that encapsulates Controller + Field + FieldError
  and pre-computes validationState, eliminating ~25 repetitive ternaries across
  8 form files
- Replace TextInput type="date" with DateInput (IMask masked input) to fix broken
  native date picker on Safari
- Add keyboard-only focus ring to TextInput using pointer tracking — ring appears
  on Tab navigation but not on mouse click
@stacelKonrad stacelKonrad requested a review from a team May 27, 2026 10:08
@stacelKonrad stacelKonrad linked an issue May 27, 2026 that may be closed by this pull request
10 tasks
Comment thread apps/presentation/features/auth/auth-register-form.tsx
Comment thread apps/presentation/components/ui/form-field.tsx
- DateInput now emits ISO (YYYY-MM-DD) on complete input and accepts ISO
  values as controlled input, fixing z.iso.date() validation failures
- Add mode: 'onTouched' to all 8 forms so fieldState.invalid is reliable
  before first submit
- Guard FormField valid state with isTouched to prevent green styling
  while the user is still typing in an unblurred field
Comment thread apps/presentation/components/ui/inputs/date-input.tsx
Comment thread apps/presentation/components/ui/inputs/text-input.tsx
Comment thread apps/presentation/components/ui/inputs/date-input.tsx Outdated
Comment on lines +104 to +106
<div
className='relative w-full'
onPointerDown={handlePointerDown}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attaching onPointerDown to the wrapper sets isPointerFocus.current even when a focusable child is clicked and the input itself never receives focus. This breaks keyboard focus handling for PasswordInput and similar inputs with interactive adornments: after clicking the visibility toggle, returning to the field with Shift+Tab or Tab causes handleFocus to suppress data-keyboard-focus, so the keyboard focus ring no longer appears. Since the flag is only cleared in the input's focus handler, pointer-focus tracking should stay off non-input descendants.

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.

FEAT: Text input component

2 participants