mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
@ -102,6 +102,13 @@ export class TextInput extends InputBase {
|
|||||||
inputFocused(event) {
|
inputFocused(event) {
|
||||||
this.focus.emit(event);
|
this.focus.emit(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
clearTextInput() {
|
||||||
|
this._value = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
5
ionic/components/input/test/clear-input/e2e.ts
Normal file
5
ionic/components/input/test/clear-input/e2e.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
it('should clear input', function() {
|
||||||
|
element(by.css('.e2eClearInput')).click();
|
||||||
|
expect(by.css('.e2eClearInput').getText()).toEqual('');
|
||||||
|
});
|
11
ionic/components/input/test/clear-input/index.ts
Normal file
11
ionic/components/input/test/clear-input/index.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import {App} from 'ionic-angular';
|
||||||
|
|
||||||
|
|
||||||
|
@App({
|
||||||
|
templateUrl: 'main.html'
|
||||||
|
})
|
||||||
|
class E2EApp {
|
||||||
|
constructor() {
|
||||||
|
this.myValue = 'value';
|
||||||
|
}
|
||||||
|
}
|
20
ionic/components/input/test/clear-input/main.html
Normal file
20
ionic/components/input/test/clear-input/main.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Clear Input</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-list>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>Text 1:</ion-label>
|
||||||
|
<ion-input class="e2eClearInput" [(ngModel)]="myValue" clearInput></ion-input>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
|
</ion-content>
|
Reference in New Issue
Block a user