MarkTraceur has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/235486

Change subject: Work around <input type=file multiple> having wrong .value on 
IE 11
......................................................................

Work around <input type=file multiple> having wrong .value on IE 11

When uploading multiple files, it would cause the file name of the
first file to be replaced with the file name of the last file.

Bug: T88223
Change-Id: I2277dda9fdac248e16317ca0f1ec5d1357096cb3
(cherry picked from commit a8a82ec17ba7ab54c9df5ed1dafb9e4ccc3c6633)
---
M resources/mw.UploadWizardUploadInterface.js
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/86/235486/1

diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index 13b7509..79a6657 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -331,7 +331,13 @@
                                return this.providedFile.name;
                        }
                } else {
-                       return this.$fileInputCtrl.get(0).value;
+                       var input = this.$fileInputCtrl.get(0);
+                       // On IE 11, input.value is incorrect for <input 
type=file multiple>, like we're using here;
+                       // the input.files interface is reliable. 
(T88223#1595320)
+                       if ( input.files && input.files[0] && 
input.files[0].name ) {
+                               return input.files[0].name;
+                       }
+                       return input.value;
                }
        };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/235486
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2277dda9fdac248e16317ca0f1ec5d1357096cb3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: wmf/1.26wmf21
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: Bartosz DziewoƄski <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to