Hey, guys.
Does anybody know how to force blur on ion-input element by Angular reference?
I was searching the forum and found one question which seems like something I am looking for: How to force Blur on ion-input
Is this solution OK? Because for me it looks hacky.
Here is the code block which my application uses:
<form (ngSubmit)="ask(question)">
<ion-item id="person-info">
<ion-label stacked>Some label</ion-label>
<ion-input type="text" required #question></ion-input>
</ion-item>
<div class="ask-person-button">
<button ion-button block type="submit">Ask person</button>
</div>
</form>
And in .ts file:
import {Component, OnInit} from '@angular/core';
import {NavParams, AlertController} from 'ionic-angular';
@Component({
selector: 'ask-person',
templateUrl: 'ask-person.html'
})
export class AskPersonPage implements OnInit {
ask(input) {
// can I use something like input.blur() ?
}
}