Connect my custom input with ion-item

Hi, i created a custom input in angular 2 but when i have a problem. I want to that ion-item show border in red when input is invalid, green when is valid or blue when is focused. Thank you !

1 Like

I’m hoping too that ion-item could see custom inputs instead of only ionic inputs to make them more flexible, after all it’s not always that a pure ionic input would work, and having some ion-items working and not the others is a real problem. But it seems to not work in such cases (yet) though :confused:

@jgw9617 @bengtler @brandyshea any news about this? From what I see there is no way to connect the custom input to the ion-item:

<ion-item>
	<ion-label stacked>Some Input</ion-label>
	<my-input item-content [formControlName]="name" [(ngModel)]="value"></my-input>
</ion-row>

My custom inputs implements ModelValueAccessor and the control have the correct state valid, invalid, etc…, but even if the control is invalid the border in the bottom is valid (green), because the ion-item is valid (if I look at the element class).

It is not difficult to have a case where the ionic inputs won’t work (isolated), even if they can be used in several cases. So it is natural to hope that we could create custom inputs and make them behave like they were the ionic ones, I think.

Will the Ionic team provide such a feature in the short or mid term?