mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-23 16:26:17 -04:00
prevent autofocus of dialog elements on mobile
This commit is contained in:
parent
fc190dd121
commit
684e43a352
4 changed files with 8 additions and 8 deletions
|
@ -342,7 +342,7 @@
|
|||
</div>
|
||||
<div class="center file-preview"></div>
|
||||
<div class="row-reverse center button-row">
|
||||
<button id="share-btn" class="button" data-i18n-key="dialogs.share" data-i18n-attrs="text" autofocus hidden>Share</button>
|
||||
<button id="share-btn" class="button" data-i18n-key="dialogs.share" data-i18n-attrs="text" hidden>Share</button>
|
||||
<button id="download-btn" class="button" data-i18n-key="dialogs.download" data-i18n-attrs="text" autofocus>Download</button>
|
||||
<button class="button" data-i18n-key="dialogs.close" data-i18n-attrs="text" close>Close</button>
|
||||
</div>
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -602,7 +602,7 @@ class Dialog {
|
|||
|
||||
show() {
|
||||
this.$el.setAttribute('show', 1);
|
||||
if (this.$autoFocus) this.$autoFocus.focus();
|
||||
if (!window.isMobile && this.$autoFocus) this.$autoFocus.focus();
|
||||
}
|
||||
|
||||
isShown() {
|
||||
|
@ -611,7 +611,7 @@ class Dialog {
|
|||
|
||||
hide() {
|
||||
this.$el.removeAttribute('show');
|
||||
if (this.$autoFocus) {
|
||||
if (!window.isMobile && this.$autoFocus) {
|
||||
document.activeElement.blur();
|
||||
window.blur();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue