I’m using Reactive Forms to build forms in an Ionic 4 beta 7 project. Validations are working correctly but invalid styles are not reflected in the forms.
After introducing an invalid value in an input, Inspecting the DOM I see that “ion-invalid” and “ng-invalid” classes are applied to the ion-input element, but the red outline doesn’t appear.
Does Ionic 4 support angular form validations? Is this a feature coming in future betas?
I have imported both FormsModule and ReactiveFormsModule. It seems more like a styling problem.
As you can see in the next code extracted from de Chrome debugger, Angular correctly applies the “ng-invalid” class on the ion-input element, but the red underline doesn’t show up.
Make sure the CSS is not overwritten and that it is not nullified by other styling. For example changing a border color has no point when a different class removes the border altogether.
You should be able to fix this with custom CSS.