[Bug]: fluent-radio-group ignores value changes while disabled

オープン 初心者向け
#37,198 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

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

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

2026年11月24日 から。

  • #37199 @pkryusuf による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
frontend

調査の方向性

radio-group.base.ts を開き、enabledRadios ゲッター、set value() アクセサー、checkRadio() と disabledChanged() を読んでください。修正は、受け取った値を有効なラジオだけでなくすべてのラジオに対して解決し、disabledChanged() をまたいで選択中のインデックスの整合性を保つことです。まず issue にある HTML スニペットを radio-group のストーリーまたはテストページで再現し、無効化中に value が無視される様子を確認してください。グループまたは対象のラジオのどちらが無効でも、選択中のラジオが value に追従し、その動作を radio-group のテストファイルのテストがカバーしていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Fluent UI WC (v3) web-components
Component

RadioGroup

Package version

3.2.1 (same logic on main)

@microsoft/fast-element version

3.0.4

Environment

Any browser. Found via Fluent UI Blazor v5, which wraps fluent-radio-group.

Current Behavior

While the group is disabled (or the target radio is disabled), setting value on fluent-radio-group is ignored and the previously checked radio stays checked.

In radio-group.base.ts, enabledRadios returns [] when the group is disabled and leaves out disabled radios. set value() looks up the new value with enabledRadios.findIndex(...) and checkRadio() only updates enabledRadios, so nothing matches. disabledChanged() resets checkedIndex, which also has no effect at that point.

Expected Behavior

The checked radio follows value even when the group or the target radio is disabled. Disabled should block user interaction, not programmatic value changes.

Reproduction

https://github.com/microsoft/fluentui-blazor/issues/5639

Steps to reproduce
<fluent-radio-group id="g" value="a">
  <fluent-radio value="a">A</fluent-radio>
  <fluent-radio value="b">B</fluent-radio>
</fluent-radio-group>
<script>
  const g = document.getElementById('g');
  g.disabled = true;
  g.value = 'b';
  // expected: radio "b" is checked, actual: radio "a" stays checked
</script>

The same happens when the group is enabled but radio "b" has disabled.

Are you reporting an Accessibility issue?

None

Suggested severity

Medium - Has workaround

Products/sites affected

Fluent UI Blazor (FluentRadioGroup). Workaround there is @key to recreate the element. Blazor-side workaround PR: https://github.com/microsoft/fluentui-blazor/pull/5658

Are you willing to submit a PR to fix?

yes

Validations
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
主要言語
TypeScript
スター
20.4k
フォーク
3k
平均マージ
3日 15時間
マージ済み PR(30日)
74

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

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

はじめの一歩

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

microsoft/fluentui のほかの issue

microsoft/fluentui の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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