From b7ecfc9925a0cf9e69000bc25b79892c2a619990 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 5 Mar 2025 19:48:39 -0500 Subject: [PATCH] ios: Fix file upload. This is the last thing I would have expected. #109 --- apps/ssb/tf-compose.js | 6 ++++-- apps/ssb/tf-profile.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/ssb/tf-compose.js b/apps/ssb/tf-compose.js index 40bc617c..6804f01a 100644 --- a/apps/ssb/tf-compose.js +++ b/apps/ssb/tf-compose.js @@ -255,10 +255,12 @@ class TfComposeElement extends LitElement { let self = this; let input = document.createElement('input'); input.type = 'file'; - input.onchange = function (event) { + input.addEventListener('change', function (event) { + input.parentNode.removeChild(input); let file = event.target.files[0]; self.add_file(file); - }; + }); + document.body.appendChild(input); input.click(); } diff --git a/apps/ssb/tf-profile.js b/apps/ssb/tf-profile.js index f280f87f..280c263f 100644 --- a/apps/ssb/tf-profile.js +++ b/apps/ssb/tf-profile.js @@ -139,7 +139,8 @@ class TfProfileElement extends LitElement { let self = this; let input = document.createElement('input'); input.type = 'file'; - input.onchange = function (event) { + input.addEventListener('change', function (event) { + input.parentNode.removeChild(input); let file = event.target.files[0]; file .arrayBuffer() @@ -154,7 +155,8 @@ class TfProfileElement extends LitElement { .catch(function (e) { alert(e.message); }); - }; + }); + document.body.appendChild(input); input.click(); }