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

オープン
#2,059 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@houko がすでに取り組んでいます。

2026年11月23日 から。

  • #2181 @houko による — オープン

評価

この issue はまだ評価されていません。

説明

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.
主要言語
Go
スター
684
フォーク
41
平均マージ
8時間 8分
マージ済み PR(30日)
911

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nsgo-dev/nsgo のほかの issue

nsgo-dev/nsgo の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。