base: Radio has no LabelFunc or HintFunc, unlike Checkbox and Button

Abierto
#2,059 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@houko ya está trabajando en esto.

Desde el 23/11/2026.

  • #2181 de @houko — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Context

base.Radio (base/radio.go:12) takes a fixed Label string but no LabelFunc, while its siblings do: base.Checkbox (base/checkbox.go:40) and base.Button (base/button.go:42) both accept LabelFunc func() string and pass it to core.View.LabelFunc. Radio has no HintFunc either, which Checkbox also has.

Why it matters

A radio whose accessible name depends on state can't keep it current. ui.FormRow with RoleRadio (since #1888) binds its row title through TitleFunc/LabelFunc, but for a radio row it can only read the bound label once at render, because base.Radio has nowhere to put the function. Screen readers then announce a stale name after the label changes.

Proposal

Add LabelFunc func() string and HintFunc func() string to base.Radio with the same meaning as on base.Checkbox (the function wins over the string when set), pass them through to the radio's core.View, and let ui.FormRow's radio role forward its bound label instead of reading it once.

Acceptance
  • A base.Radio with a LabelFunc whose result changes reports the new accessible name without a re-render of its parent, as base.Checkbox does (a test like Checkbox's).
  • ui.FormRow with RoleRadio and a changing TitleFunc updates the radio's accessible name.
Lenguaje dominante
Go
Estrellas
684
Forks
41
Merge medio
8 h 8 min
PR fusionados (30 d)
911

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nsgo-dev/nsgo

Todos los issues de nsgo-dev/nsgo

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.