@@ -174,9 +174,6 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
174174 * ```
175175 */
176176 public get disabled ( ) {
177- if ( this . ngControl && this . ngControl . disabled !== null ) {
178- return this . ngControl . disabled ;
179- }
180177 return this . _disabled ;
181178 }
182179
@@ -268,6 +265,10 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
268265 this . inputGroup . hasPlaceholder = this . nativeElement . hasAttribute (
269266 'placeholder'
270267 ) ;
268+
269+ if ( this . ngControl && this . ngControl . disabled !== null ) {
270+ this . disabled = this . ngControl . disabled ;
271+ }
271272 this . inputGroup . disabled =
272273 this . inputGroup . disabled ||
273274 this . nativeElement . hasAttribute ( 'disabled' ) ;
@@ -352,8 +353,8 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
352353 if ( ! this . disabled && ( this . ngControl . control . touched || this . ngControl . control . dirty ) ) {
353354 // the control is not disabled and is touched or dirty
354355 this . _valid = this . ngControl . invalid ?
355- IgxInputState . INVALID : this . focused ? IgxInputState . VALID :
356- IgxInputState . INITIAL ;
356+ IgxInputState . INVALID : this . focused ? IgxInputState . VALID :
357+ IgxInputState . INITIAL ;
357358 } else {
358359 // if control is untouched, pristine, or disabled its state is initial. This is when user did not interact
359360 // with the input or when form/control is reset
@@ -459,8 +460,8 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
459460 private checkNativeValidity ( ) {
460461 if ( ! this . disabled && this . _hasValidators ( ) ) {
461462 this . _valid = this . nativeElement . checkValidity ( ) ?
462- this . focused ? IgxInputState . VALID : IgxInputState . INITIAL :
463- IgxInputState . INVALID ;
463+ this . focused ? IgxInputState . VALID : IgxInputState . INITIAL :
464+ IgxInputState . INVALID ;
464465 }
465466 }
466467
0 commit comments