Skip to content

Commit

Permalink
fix(input): clear text input
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Pekes317 authored and adamdbradley committed Apr 25, 2016
1 parent 9d4ded1 commit bde103d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ionic/components/input/input-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export class InputBase {
*/
clearTextInput() {
console.debug('Should clear input');
this._value = '';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ionic/components/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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" 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>',
directives: [
NgIf,
Expand Down

0 comments on commit bde103d

Please sign in to comment.