From fba660149efc7d9285d319d64f3cc563c97d2312 Mon Sep 17 00:00:00 2001 From: hackademix Date: Thu, 30 May 2019 13:23:35 +0200 Subject: Further work-around for setting importation file picking inconsistencies on Android. --- src/ui/options.css | 16 ++++++++++++++-- src/ui/options.html | 4 +++- src/ui/options.js | 7 +++++-- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src/ui') diff --git a/src/ui/options.css b/src/ui/options.css index ca64859..652a9bf 100644 --- a/src/ui/options.css +++ b/src/ui/options.css @@ -129,8 +129,20 @@ button.add { font-weight: bold; } -input[type="file"] { - display: none; +#import-container { + position: relative; +} +#file-import { + position: absolute; + top: 0; + left: 0; + opacity: 0; + width: 100%; + padding: 0; + margin: 0; + border: none; + -moz-appearance: none; + appearance: none; } .opt-group { diff --git a/src/ui/options.html b/src/ui/options.html index 5053ef7..1ccc62f 100644 --- a/src/ui/options.html +++ b/src/ui/options.html @@ -24,8 +24,10 @@
diff --git a/src/ui/options.js b/src/ui/options.js index 4588330..75f1280 100644 --- a/src/ui/options.js +++ b/src/ui/options.js @@ -61,8 +61,11 @@ fr.readAsText(fileInput.files[0]); } - document.querySelector("#btn-import").addEventListener("click", - () => fileInput.click()); + document.querySelector("#btn-import").addEventListener("click", async e => { + fileInput.focus(); + fileInput.click(); + e.target.focus(); + }); document.querySelector("#btn-export").addEventListener("click", async e => { let button = e.target; -- cgit v1.2.3