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(); }