fix(input): clear text input

* Added Type Button

To prevent the clear button to call submit function if ngSubmit is used.

* Clear Input Action.

Added a change value action to the clearTextInput function. It now actually clears input
This commit is contained in:
Pekes317
2016-04-25 08:42:22 -05:00
committed by Adam Bradley
parent 9d4ded1d31
commit bde103d2fb
2 changed files with 2 additions and 1 deletions

View File

@ -406,6 +406,7 @@ export class InputBase {
*/ */
clearTextInput() { clearTextInput() {
console.debug('Should clear input'); console.debug('Should clear input');
this._value = '';
} }
/** /**

View File

@ -67,7 +67,7 @@ import {Platform} from '../../platform/platform';
template: template:
'<input [type]="type" [(ngModel)]="_value" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" [placeholder]="placeholder" class="text-input">' + '<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">' + '<input [type]="type" aria-hidden="true" next-input *ngIf="_useAssist">' +
'<button clear *ngIf="clearInput && value" class="text-input-clear-icon" (click)="clearTextInput()" (mousedown)="clearTextInput()"></button>' + '<button clear *ngIf="clearInput && value" 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>', '<div (touchstart)="pointerStart($event)" (touchend)="pointerEnd($event)" (mousedown)="pointerStart($event)" (mouseup)="pointerEnd($event)" class="input-cover" tappable *ngIf="_useAssist"></div>',
directives: [ directives: [
NgIf, NgIf,