mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 03:52:52 +00:00
refactor: make keyboard dismissable on search bars
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
import {Component, Input, OnInit, OnDestroy} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
import {Keyboard} from '@capacitor/keyboard';
|
||||
import {AlertController} from '@ionic/angular';
|
||||
import {
|
||||
SCFacet,
|
||||
@@ -214,6 +215,13 @@ export class SearchPageComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides keyboard in native app environments
|
||||
*/
|
||||
hideKeyboard() {
|
||||
Keyboard.hide();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set starting values (e.g. forced filter, which can be set in components inheriting this one)
|
||||
*/
|
||||
|
||||
@@ -12,9 +12,12 @@
|
||||
</ion-buttons>
|
||||
<ion-searchbar
|
||||
(ngModelChange)="searchStringChanged($event)"
|
||||
(keyup.enter)="hideKeyboard()"
|
||||
[(ngModel)]="queryText"
|
||||
showClearButton="always"
|
||||
placeholder="{{ 'search.search_bar.placeholder' | translate }}"
|
||||
showClearButton="always"
|
||||
type="search"
|
||||
enterkeyhint="search"
|
||||
>
|
||||
</ion-searchbar>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -12,9 +12,12 @@
|
||||
</ion-buttons>
|
||||
<ion-searchbar
|
||||
(ngModelChange)="searchStringChanged($event)"
|
||||
(keyup.enter)="hideKeyboard()"
|
||||
[(ngModel)]="queryText"
|
||||
showClearButton="always"
|
||||
placeholder="{{ 'hebisSearch.search_bar.placeholder' | translate }}"
|
||||
showClearButton="always"
|
||||
type="search"
|
||||
enterkeyhint="search"
|
||||
>
|
||||
</ion-searchbar>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Keyboard} from '@capacitor/keyboard';
|
||||
import {
|
||||
AlertController,
|
||||
IonRouterOutlet,
|
||||
@@ -276,6 +277,13 @@ export class MapPageComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides keyboard in native app environments
|
||||
*/
|
||||
hideKeyboard() {
|
||||
Keyboard.hide();
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to needed observables and get the location status when user is entering the page
|
||||
*/
|
||||
|
||||
@@ -27,10 +27,13 @@
|
||||
</ion-buttons>
|
||||
<ion-searchbar
|
||||
(keyup)="searchKeyUp($event)"
|
||||
(keyup.enter)="hideKeyboard()"
|
||||
[(ngModel)]="queryText"
|
||||
(ionClear)="searchStringChanged()"
|
||||
placeholder="{{ 'map.page.search_bar.placeholder' | translate }}"
|
||||
showClearButton="always"
|
||||
type="search"
|
||||
enterkeyhint="search"
|
||||
>
|
||||
</ion-searchbar>
|
||||
<ion-buttons slot="end">
|
||||
|
||||
Reference in New Issue
Block a user