ionic-keyboard

Is there any way to hide keyboard when focusing an ion-input?

感情迁移 提交于 2020-08-07 08:13:32
问题 I wanted to have an ion-input that will be focused and the keyboard should not appear. Is there any way or is it possible? Thank you! 回答1: yes, install this plugin -> https://ionicframework.com/docs/native/keyboard/ html <ion-input type="text" [(ngModel)]="message" (ionFocus)="keyboard_show()" #input ></ion-input> ts import { Keyboard } from '@ionic-native/keyboard'; constructor(private keyboard: Keyboard, private ) { } keyboard_show(){ this.keyboard.close(); } 回答2: I tried Kevin's answer and

How to prevent ionic keyboard from hiding

社会主义新天地 提交于 2019-12-11 08:26:14
问题 How can I prevent ionic keyboard from hiding when I press a specific button in my Ionic 1 app? This solution doesn't work for me, the keyboard remains open wherever I click. 回答1: A possible solution can be found here (the same link sent by Sahil Dhir). I also had this problem and this solution worked for me. The directive is: angular.module('msgr').directive('isFocused', function($timeout) { return { scope: { trigger: '@isFocused' }, link: function(scope, element) { scope.$watch('trigger',