diff --git a/src/components/input/input.scss b/src/components/input/input.scss index 71bd9e1f86..04ad51c18d 100644 --- a/src/components/input/input.scss +++ b/src/components/input/input.scss @@ -94,7 +94,7 @@ input.text-input:-webkit-autofill { height: 100%; } -ion-input[disabled] .input-cover { +.input[disabled] .input-cover { pointer-events: none; } diff --git a/src/components/input/input.ts b/src/components/input/input.ts index fffc582a40..5724949c65 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -216,7 +216,7 @@ export class TextInput extends Ion implements IonicFormInput { */ @Input() get disabled() { - return this.ngControl ? this.ngControl.disabled : this._disabled; + return this._disabled; } set disabled(val: boolean) { this.setDisabled(this._disabled = isTrueProperty(val)); @@ -226,10 +226,18 @@ export class TextInput extends Ion implements IonicFormInput { * @private */ setDisabled(val: boolean) { + this._renderer.setElementAttribute(this._elementRef.nativeElement, 'disabled', val ? '' : null); this._item && this._item.setElementClass('item-input-disabled', val); this._native && this._native.isDisabled(val); } + /** + * @private + */ + setDisabledState(isDisabled: boolean) { + this.disabled = isDisabled; + } + /** * @input {boolean} If the input should be readonly or not */