[Bug]: fluent-radio-group ignores value changes while disabled
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Mở radio-group.base.ts và đọc getter enabledRadios, accessor set value(), checkRadio() và disabledChanged(); cách sửa là phân giải giá trị đầu vào dựa trên tất cả các radio (không chỉ những radio đang bật) và giữ chỉ số đã chọn nhất quán qua disabledChanged(). Hãy tái hiện trước bằng đoạn HTML trong issue ở story hoặc trang kiểm thử của radio-group, để quan sát value bị bỏ qua khi đang bị vô hiệu hóa. Hoàn thành khi radio được chọn bám theo value, dù nhóm hay radio đích bị vô hiệu hóa, và có một test trong file kiểm thử của radio-group bao phủ điều này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 20.4k
- Fork
- 3k
- Merge trung bình
- 3 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 74
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/fluentui
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: Toaster throws in development when it has a style propCó thể đã có người làm @jakesalvesen đã nhận 35 ngày trước. Đang mởComponent: Toast Fluent UI react-components (v9) Type: Bug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: AriaLiveAnnouncer holds back a message announced in the commit that mounts itCó thể đã có người làm @dmytrokirpa đã nhận 2 ngày trước. Đang mởArea: Accessibility Fluent UI react-components (v9) Type: Bug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/fluentui#37202 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: MessageBar announces the title and body without a space between themCó thể đã có người làm @jakesalvesen đã nhận 2 ngày trước. Đang mởFluent UI react-components (v9) Type: Bug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: Accordion crashes for scalar `defaultOpenItems={0}` (headless and styled v9)Có thể đã có người làm @arniebradfo đã nhận 22 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/fluentui
Issue tương tự
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Có thể đã có người làm @goranai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Inbox permission: an allow sent with `updatedInput` is ignored by Claude Code on its own safety checksCó thể đã có người làm @Raj1v đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
backnotprop/plannotator#4046 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
進捗部屋の管理画面で削除対象を月ごとに絞り込むĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
traPtitech/knoQ_R-UI#290 ·
Maintainer thường phản hồi trong vòng 24 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
farion1231/cc-switch#9981 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
account bug course exam iris lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày