The shared Input renders a visible label without associating it with the field. ## 复现 离线渲染两个 `Input`,一个传 `id="price"` 和 `label="Target Price"`,另一个只传 `label="Minimum Weight"`。两个可见 `<label>` 都没有 `for` 属性,也都在输入框外部。提醒表单等使用这套组件的页面因此缺少原生的标签关联。 ## 验收标准 - [ ] 有 `label` 的 `Input` 用对应输入框的 ID 建立标签关联。调用方传入 ID 时使用该值,省略 ID 时同页的多个字段各有自己的关联。 - [ ] 组件测试覆盖显式 ID 与两个自动关联的字段,可通过标签分别找到输入框。 ## 源码与测试入口 - 检查共享组件输出的 `label` 和 `input`。 [通用 Input](https://github.com/ydflow/Trail/blob/06133c4d1f83f5465fce4a8eda199a70feb35606/packages/ui/src/components/primitives/Input.tsx#L4-L29) - 可用 `installHappyDom` 渲染多个输入框并验证关联。 [UI 测试 DOM](https://github.com/ydflow/Trail/blob/06133c4d1f83f5465fce4a8eda199a70feb35606/packages/ui/src/test/setupHappyDom.ts) 想处理这项任务,可以评论 `/claim`。提交 PR 时请关联本 Issue,并附上实际运行的测试命令和结果。 [贡献指南](https://github.com/ydflow/Trail/blob/main/CONTRIBUTING.md)
Activity