mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
feat(Input): added functionality for clear input option on ion-input
Implemented function to handle when the clearInput button is pressed on an ion-input element
This commit is contained in:
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)]="myParam" clearInput></ion-input>
|
||||
</ion-item>
|
||||
|
||||
|
||||
</ion-list>
|
||||
|
||||
</ion-content>
|
Reference in New Issue
Block a user