fix(input): remove old clearInput code and clean up UI, added onChange calls

references #6514
This commit is contained in:
Brandy Carney
2016-05-12 18:55:24 -04:00
parent 619f119d9b
commit 71cd297751
7 changed files with 27 additions and 26 deletions

View File

@ -66,7 +66,7 @@ import {Platform} from '../../platform/platform';
template:
'<input [type]="type" [(ngModel)]="_value" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" [placeholder]="placeholder" class="text-input">' +
'<input [type]="type" aria-hidden="true" next-input *ngIf="_useAssist">' +
'<button clear *ngIf="clearInput && value" type="button" class="text-input-clear-icon" (click)="clearTextInput()" (mousedown)="clearTextInput()"></button>' +
'<button clear [hidden]="!clearInput" type="button" class="text-input-clear-icon" (click)="clearTextInput()" (mousedown)="clearTextInput()"></button>' +
'<div (touchstart)="pointerStart($event)" (touchend)="pointerEnd($event)" (mousedown)="pointerStart($event)" (mouseup)="pointerEnd($event)" class="input-cover" tappable *ngIf="_useAssist"></div>',
directives: [
NextInput,
@ -107,7 +107,10 @@ export class TextInput extends InputBase {
* @private
*/
clearTextInput() {
console.debug("Should clear input");
this._value = '';
this.onChange(this._value);
this.writeValue(this._value);
}
}