ionic-team / ionic-team/ionic-framework

feat: Allow integration of Angular custom form controls with ion-item validation behavior

Đang mở
#21,903 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
package: angular type: feature request
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

# Feature Request

**Ionic version:**

[x] 5.3.1

**Describe the Feature Request**

Ionic/Angular has a nice UI feature that presents validation status to users in the form of CSS classes that map to the ng form control classes. eg,` ng-valid/ng-invalid` maps to `ion-valid/ion-invalid` etc. And these classes somehow get pushed to the containing `ion-item` of the control which does the actual presentation.

We have several custom form control components and we would like to have them behave in the same manner. But there doesn't seem to be an easy way to integrate with this functionality.

Please provide a mechanism to integrate custom form controls with the ion-item valid/invalid presentation behavior.

We currently cannot implement this behavior and our forms do not function well when custom form controls are used within `ion-item` lists.

**Describe Preferred Solution**

An abstract version of Ionic's [`ValueAccessor`](https://github.com/ionic-team/ionic-framework/blob/master/angular/src/directives/control-value-accessors/value-accessor.ts) class that components could extend would be nice. This seems to be where the magic happens.

**Describe Alternatives**

Alternatively, a number of public hooks that could be called to patch the Angular functions and set the Ionic classes would also work.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.