mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
fix: make keyboard dismissable on mobile devices
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
import {Component} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
import {Capacitor} from '@capacitor/core';
|
||||
import {Keyboard} from '@capacitor/keyboard';
|
||||
|
||||
/**
|
||||
* Shows a search input field
|
||||
@@ -32,6 +34,17 @@ export class SearchSectionComponent {
|
||||
* User submits search
|
||||
*/
|
||||
onSubmitSearch() {
|
||||
this.router.navigate(['/search', this.searchTerm]);
|
||||
this.router
|
||||
.navigate(['/search', this.searchTerm])
|
||||
.then(() => this.hideKeyboard());
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides keyboard in native app environments
|
||||
*/
|
||||
hideKeyboard() {
|
||||
if (Capacitor.isNativePlatform()) {
|
||||
Keyboard.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user