From ac5e0e5f5f50789be9122291b2375cfceb860c67 Mon Sep 17 00:00:00 2001 From: Rasmus Spiegelberg Date: Tue, 1 Oct 2019 15:16:51 +0200 Subject: [PATCH] Fix File.decoder for IE11 --- src/Elm/Kernel/File.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Elm/Kernel/File.js b/src/Elm/Kernel/File.js index 5bcd3ad..e20ca90 100755 --- a/src/Elm/Kernel/File.js +++ b/src/Elm/Kernel/File.js @@ -15,7 +15,11 @@ import Time exposing (millisToPosix) var _File_decoder = __Json_decodePrim(function(value) { // NOTE: checks if `File` exists in case this is run on node - return (typeof File !== 'undefined' && value instanceof File) + // IE10 and IE11 events contain `File`-like `Blob`s + return ( + (typeof File !== 'undefined' && value instanceof File) || + (typeof Blob !== 'undefined' && value instanceof Blob && value.name) + ) ? __Result_Ok(value) : __Json_expecting('a FILE', value); });