[Bug]: slotted labels not associated with input during hydration in fluent-field
Maintainer thường phản hồi trong vòng 1 ngày
@chrisdholt đang làm issue này rồi.
Từ ngày 15/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
🐛 Bug Report
When a <fluent-field> is server-rendered and hydrated, its initial slotted label and input are not associated. The label remains without for or id, and the input remains without aria-labelledby.
💻 Repro or Code Sample
Server-render and hydrate this markup:
<fluent-field>
<label slot="label">Label</label>
<input id="input" slot="input" />
</fluent-field>
After hydration, inspect the slotted elements or assert:
await expect(label).toHaveAttribute("for", "input");
await expect(label).toHaveAttribute("id", "input--label");
await expect(input).toHaveAttribute("aria-labelledby", "input--label");
The failure reproduces in the chromium-ssr Playwright project.
🤔 Expected Behavior
Initial connection should associate the slotted label and input:
<label slot="label" for="input" id="input--label">Label</label>
<input id="input" slot="input" aria-labelledby="input--label" />
😯 Current Behavior
The association attributes remain unset after hydration:
Error: expect(locator).toHaveAttribute(expected) failed
Locator: locator('fluent-field').locator('label')
Expected: "input"
Received: ""
No component error is thrown, but clicking the label may not focus the input and assistive technology may not receive the label as the input's accessible name.
💁 Possible Solution
setLabelProperties() checks $fastController.isConnected. During hydration, the initial labelSlotChanged and inputChanged callbacks can run before the controller reports that it is connected. The method skips its work, and Field does not call it again after connection.
Remove the connection guard and add an SSR regression test for the generated association attributes. I am willing to contribute the fix and test.
As an alternative, authors can provide definite id and for attributes on their slotted label, and a matching aria-labelledby attribute on the slotted input. We should add tests for both scenarios.
🔦 Context
This affects server-rendered forms using the Fluent Field web component. Client-side rendering works, but hydration leaves the initial label and input without their expected accessibility association.
🌍 Your Environment
- OS & Device: macOS on Mac
- Browser: Chromium through Playwright's
chromium-ssrproject - Version:
@fluentui/web-components3.1.2 - FAST Element:
@microsoft/fast-element3.0.2 - Node.js: 24.18.0
- Ngôn ngữ chính
- TypeScript
- Star
- 20.3k
- Fork
- 2.9k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 72
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
-
[Bug]: Button shims in react-migration-v8-v9 always render the ms-Button--primary classCó thể đã có người làm @jakesalvesen đã nhận hôm nay. Đang mởFluent UI react-components (v9) Needs: Triage :mag: 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 1 ngày
-
[Bug]: AreaChart renders SVG rect with negative width and height on initial renderCó thể đã có người làm @huong8373tt-beep đã nhận 1 ngày trước. Đang mởNeeds: Triage :mag: Package: charting Type: Bug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Vertical Slider still logs the deprecated 'slider-vertical' warning in Chromium 132+Có thể đã có người làm @jakesalvesen đã nhận 3 ngày trước. Đang mởFluent UI react-components (v9) Needs: Triage :mag: Type: Bug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
microsoft/fluentui#36945 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ 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 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/fluentui
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
db-ux-design-system/core-web#8613 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
foxglove/mcap#1907 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug internal-plugin pr-welcome upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dsh-tauri-desk/deepseek-harness-desktop#1225 · 1 bình luận ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
unjs/unhead#1027 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày