fix(input): add/remove disabled on native text input

Close #5280
This commit is contained in:
Adam Bradley
2016-02-01 14:16:44 -06:00
parent 3e8b7ca96d
commit 11b8e08567
5 changed files with 40 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import {Content} from '../content/content';
import {Form} from '../../util/form';
import {Item} from '../item/item';
import {IonicApp} from '../app/app';
import {isTrueProperty} from '../../util/util';
import {Label} from '../label/label';
import {pointerCoord, hasPointerMoved, closest} from '../../util/dom';
import {NavController} from '../nav/nav-controller';
@ -16,6 +17,7 @@ import {Platform} from '../../platform/platform';
export class InputBase {
protected _coord;
protected _deregScroll;
protected _disabled: boolean = false;
protected _keyboardHeight;
protected _scrollMove: EventListener;
protected _type: string = 'text';
@ -136,6 +138,17 @@ export class InputBase {
}
}
@Input()
get disabled() {
return this._disabled;
}
set disabled(val) {
this._disabled = isTrueProperty(val);
this._item && this._item.setCssClass('item-input-disabled', this._disabled);
this._native && this._native.isDisabled(this._disabled);
}
/**
* @private
*/
@ -161,6 +174,7 @@ export class InputBase {
});
this.checkHasValue(nativeInput.getValue());
this.disabled = this._disabled;
}
/**