简体   繁体   English

尝试从 angular 材料制作自定义表单字段控件时,有没有办法消除焦点?

[英]Is there a way to remove focus when trying to make custom form field control from angular material?

So I'm building a custom form field, but I don't want to force the user to fill the first field first, then second then third like in the example .所以我正在构建一个自定义表单字段,但我不想强迫用户先填写第一个字段,然后是第二个,然后是第三个,就像示例中一样。 Is there a way to do this?有没有办法做到这一点?

example on stackblitz stackblitz 上的示例

Assuming your custom form field looks exactly like the stack blitz;假设您的自定义表单字段看起来与堆栈闪电战一模一样; it appears to just be a matter of commenting out/deleting the "onContainerClick()" function at line 194.这似乎只是在第 194 行注释掉/删除“onContainerClick()”function 的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular Material:mat-form-field 在创建自定义表单域控件时必须包含一个 MatFormFieldControl - Angular Material: mat-form-field must contain a MatFormFieldControl when creating a custom form field control Angular 10:在 Angular Material 自定义表单字段控件中访问 NgControl - Angular 10: Access NgControl in an Angular Material custom form field control 角材料:“自定义表单字段控件”-移动浮动标签(向下) - Angular Material: Custom Form Field Control - move floating label (down) 角度材料自定义控件,在提交表单时也会显示错误 - angular material custom control that displays errors also when the form is submitted 角材料窗体字段控件为null - Angular Material form field control is null Angular 素材集初始关注表单控件无点击事件 - Angular Material set initial focus on form control without click event 在自定义角度材料表格字段上的验证 - Validation on Custom Angular Material Form Field 带有验证错误的 Angular6 Material 自定义表单字段控件(mat-error) - Angular6 Material custom form field control with validation errors (mat-error) Angular Material自定义窗体字段控件的值不会在调用FormGroup中更新 - Angular Material custom form field control's value is not updated in the calling FormGroup 从焦点上和离开焦点时的材料输入中删除 label - Remove label from material input on focus and when leave focus
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM