prevent autofocus of dialog elements on mobile

This commit is contained in:
schlagmichdoch 2023-09-18 22:32:21 +02:00
parent fc190dd121
commit 684e43a352
4 changed files with 8 additions and 8 deletions

View file

@ -1,8 +1,8 @@
const $ = query => document.getElementById(query);
const $$ = query => document.body.querySelector(query);
window.isProductionEnvironment = !window.location.host.startsWith('localhost');
window.iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
window.android = /android/i.test(navigator.userAgent);
window.isMobile = window.iOS || window.android;
window.pasteMode = {};
window.pasteMode.activated = false;
@ -600,7 +600,7 @@ class Dialog {
show() {
this.$el.setAttribute('show', 1);
if (this.$autoFocus) this.$autoFocus.focus();
if (!window.isMobile && this.$autoFocus) this.$autoFocus.focus();
}
isShown() {
@ -609,7 +609,7 @@ class Dialog {
hide() {
this.$el.removeAttribute('show');
if (this.$autoFocus) {
if (!window.isMobile && this.$autoFocus) {
document.activeElement.blur();
window.blur();
}