Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

<Label> has no way of providing the input value

Aperta
#568 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
elixir
Ambito
frontend

Direzione di ricerca

Start at the Label component and trace its use of input_id/2 versus input_id/3, using the reproduction markup with a nested RadioButton as the behavioral check. The work is done when the label correctly selects a nested radio button or supports an explicit input value for cases where wrapping is not feasible.

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

Descrizione

Describe the bug

The Label component internally uses input_id/2, never input_id/3. The generated for attribute is never correct for a radio button or checkbox.

As a workaround, I am currently doing

<Label opts={for: nil}>
  <RadioButton value="value" />
  label text
</Label>

How to reproduce it

Clicking on the label text with this markup

<Label>
  <RadioButton value="value" />
  label text
</Label>

There are probably also legitimate use cases where wrapping the around the input is not feasible, so it would be good to allow <Label value={...}>text</Label> or similar.

does not select the nested radio button.

Your Environment

Surface: v0.7.0
LiveView: v0.17.6
Elixir: v1.13.0 (compiled with Erlang/OTP 24)

Lingua principale
Elixir
Stelle
2.1k
Fork
146
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 surface-ui/surface

Tutte le issue di surface-ui/surface

Issue simili

Altre issue su Elixir

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.