jenkins-bot has submitted this change and it was merged.
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(-)
Approvals:
Alex Monk: Looks good to me, approved
jenkins-bot: Verified
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/235485
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2277dda9fdac248e16317ca0f1ec5d1357096cb3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: wmf/1.26wmf20
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits