私信 访问主页
When using igx-input-group, there is no UI feedback after ReactiveForm s markAsTouched is called.
Steps to reproduceGo to https://stackblitz.com/edit/igx-editors-v5-2-1 (using igx-form-group class)Click SUBMIT buttonGo to https://stackblitz.com/edit/igx-editors-issue (using igx-input-group component)Click SUBMIT buttonResultOn the step 4, there is no UI feedback.
Expected resultThere should be UI feedback.
I used igx-form-group class before and it worked well. I want igx-input-group to work as well.
该提问来源于开源项目 IgniteUI/igniteui-angular
点赞 写回答 收藏 复制链接分享 删除 再等等 结题 再想想 12条回答私信 访问主页
not sure about this. You should do what you need to do to make it work. I m just glad the UI issue was addressed.
点赞 评论 复制链接分享私信 访问主页
if the initial value of fullName is blank, igx-input-group doesn t get any UI feedback after clicking Submit button.
https://stackblitz.com/edit/angular-t9inrw
So I think we still need to call updateValueAndValidity, though...
Could you tell me your thoughts on this?
By the way, here is my sample using updateValueAndValidity.https://stackblitz.com/edit/igx-editors-issue
点赞 评论 复制链接分享私信 访问主页
the above workaround is no longer required. This sample shows the new ways to work with ReactiveForms and radio buttons.
https://stackblitz.com/angular/xlodgdreenr?file app%2Fradio-group-sample%2Fradio-group-sample.component.ts
点赞 评论 复制链接分享私信 访问主页
do you have a working project you can share?
点赞 评论 复制链接分享私信 访问主页
It s not yet in the docs, but it s on the TODO list.
点赞 评论 复制链接分享私信 访问主页
Has this required workaround been put in public docs?
点赞 评论 复制链接分享私信 访问主页
What I was concerned about was resolved by your additional commit. Thank you so much!https://github.com/IgniteUI/igniteui-angular/commit/b0cf011dd5b66bd994c1436b6ac7de054e3d7897#diff-6f41a12bd84d5e6d3bad3cad109e10c3R81
点赞 评论 复制链接分享私信 访问主页
, yes what you just explained is essentially the issue here and why we need to call updateValueAndValidity
点赞 评论 复制链接分享私信 访问主页
,
I understand why we need to call updateValueAndValidity. Thank you for your great work!https://github.com/IgniteUI/igniteui-angular/commit/d56386b8cc310e9ba6a140aec0637847699dc083#diff-6f41a12bd84d5e6d3bad3cad109e10c3R125
Note, that it used to work previously as we had a style that was applied when angular adds ng-touched to the component s classlist, but this is no longer the case.
I m a little concerned. For example, when just focusing in/out an input, Reactive Forms adds ng-touched class but doesn t emit statusChanges. So I guess IgxInput cannot know whether the input has been touched or not.
点赞 评论 复制链接分享私信 访问主页
I have just committed a fix for this. However, it requires a small change in the sample for it to work properly. Since markAsTouched simply sets the form control s touched field to true, we have no way of reacting to it, so you need to call updateValueAndValidity after you call markAsTouched:
typescriptif (!this.form.valid) { for (let key in this.form.controls) { this.form.controls[key].markAsTouched(); this.form.controls[key].updateValueAndValidity();
Note, that it used to work previously as we had a style that was applied when angular adds ng-touched to the component s classlist, but this is no longer the case.
点赞 评论 复制链接分享私信 访问主页
, I m sorry about that.
Here is the first link.https://stackblitz.com/edit/igx-editors-v5-2-1
Here is the second link.https://stackblitz.com/edit/igx-editors-issue
I have fixed the links in the Steps to reproduce as well.
点赞 评论 复制链接分享私信 访问主页
sorry, I can t open the samples.
点赞 评论 复制链接分享 提交 再想想 采纳 为你推荐 在JavaScript中加密字符串并使用RSA技术在PHP中解密 javascriptcryptographyencryptionphp 1个回答 点击登录 提问题 欢迎建议意见 . 如何写高质量提问和回答? 采纳榜7天 被采纳次数本文链接: http://igxgroup.immuno-online.com/view-776538.html