mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
fix(input): remove old clearInput code and clean up UI, added onChange calls
references #6514
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user