Form fields: label-row slot, focusable read-only, SelectField ref and readOnly, AddressField trailing action

Aperta
#252 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

@pasevin ci sta già lavorando.

Dal 12/11/2026.

  • #261 di @pasevin — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

Start with the referenced BaseField.tsx, TextField.tsx, SelectField.tsx, AddressField.tsx, and select.tsx files in packages/components/src/components. Trace how labels, readOnly, refs, and end slots are handled across the field family, then check the related component tests. Done when the requested optional props work with defaults unchanged and SelectField forwards its ref and supports readOnly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

cla: allowlist

Moving my forms onto the kit's fields (react-hook-form), a few things needed workarounds:

  • Label row. label is a string (BaseField.tsx#L31), so there's no place for an "Optional" chip or an action like "Address book" next to it. AddressField's announcerEndSlot sits below the input (AddressField.tsx#L557-L574).
  • Read-only that keeps focus. readOnly becomes disabled on both the Controller and the input (TextField.tsx#L104, #L153). While a save is in flight I want the values readable and focus kept, not dropped to the body.
  • SelectField. It has no readOnly (SelectField.tsx#L70-L82), and field.ref never reaches the trigger (#L141-L143), even though SelectTrigger forwards a ref (select.tsx#L13). So setFocus and focus-on-first-error skip selects.

Suggested, all optional, defaults unchanged

  • labelEnd?: ReactNode on the BaseField family, and inputEnd?: ReactNode on AddressField
  • readOnlyMode: 'disabled' | 'readonly' (default 'disabled', as today), with a read-only look on Input
  • pass field.ref to SelectTrigger, and support readOnly on SelectField
Lingua principale
TypeScript
Stelle
7
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenZeppelin/openzeppelin-ui

Tutte le issue di OpenZeppelin/openzeppelin-ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.