mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(input): add event emitters for blur and focus to the ion-input component
fixes #5487
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
import {App} from 'ionic-angular';
|
||||
import {App, Page} from 'ionic-angular';
|
||||
|
||||
|
||||
@App({
|
||||
@Page({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {
|
||||
class PageOne {
|
||||
url;
|
||||
input1: string = 'Text 1';
|
||||
|
||||
constructor() {
|
||||
this.input1 = 'Text 1';
|
||||
onEvent(event) {
|
||||
console.log("Did Event:", event.type);
|
||||
}
|
||||
}
|
||||
|
||||
@App({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
class E2EApp {
|
||||
root = PageOne;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
|
||||
<ion-item>
|
||||
<ion-label fixed>To</ion-label>
|
||||
<ion-input [(ngModel)]="input1"></ion-input>
|
||||
<ion-input [(ngModel)]="input1"
|
||||
(blur)="onEvent($event)"
|
||||
(input)="onEvent($event)"
|
||||
(focus)="onEvent($event)">
|
||||
</ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
@@ -29,7 +33,11 @@
|
||||
|
||||
<ion-item>
|
||||
<ion-label fixed>Comments</ion-label>
|
||||
<ion-textarea value="Comment value"></ion-textarea>
|
||||
<ion-textarea value="Comment value"
|
||||
(blur)="onEvent($event)"
|
||||
(input)="onEvent($event)"
|
||||
(focus)="onEvent($event)">
|
||||
</ion-textarea>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
|
||||
Reference in New Issue
Block a user