angular / angular/components

Support for composite forms

未关闭
#10,508 9 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
area: material/form-field P4
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

#### feature request: Support for composite forms

#### What is the expected behavior?
Allow building of composite forms using material components.

#### What is the current behavior?
The controls won't pick up the correct parent form when in a composite form so their errors won't be shown according to the error state matcher. There are also no hooks for listening for blur on controls like select so we can propagate the touch event.

#### What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-3vwszx
In the above stackbliz, is an example using just 2 inputs for first name, last name. In my use case there would be more than just 2 inputs but it demonstrates the issue. On the composite form when submit is clicked, the error messages are not shown. On the inline form when submit is clicked, the error messages correctly display.

#### What is the use-case or motivation for changing an existing behavior?
Being able to group many different controls under one composite control so it can be easily reused inside of a reactive or template driven form.

#### Is there anything else we should know?
Using the principles explained in the angular connect talk here https://www.youtube.com/watch?v=CD_t3m2WMM8&feature=youtu.be&t=1645

贡献指南

打开贡献指南

调研方向

从链接的 StackBlitz 复现开始,并比较点击 Submit 时的组合式表单与内联响应式表单或模板驱动表单。查看 issue 中链接的 Angular Connect 原则,然后跟踪 material controls 如何找到其父表单并公开 blur 或 touch 状态。完成标准是可复用的组合式表单能够显示控件错误,并一致地传递 touch 状态。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。