diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 13:36:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 13:36:03 +0000 |
commit | 39b0e286bcf1239424eed8e0dac118a9f4f4b6ac (patch) | |
tree | 3cee07417e86b487913af6dd0d2084da31fa3f1c /app/assets/javascripts/lib/utils/forms.js | |
parent | 9fc4650da6efa808960b28f9e77fede55424d77e (diff) | |
download | gitlab-ce-39b0e286bcf1239424eed8e0dac118a9f4f4b6ac.tar.gz |
Add latest changes from gitlab-org/gitlab@12-4-stable-ee
Diffstat (limited to 'app/assets/javascripts/lib/utils/forms.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/forms.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/forms.js b/app/assets/javascripts/lib/utils/forms.js index 106209a2f3a..ced44ab9817 100644 --- a/app/assets/javascripts/lib/utils/forms.js +++ b/app/assets/javascripts/lib/utils/forms.js @@ -4,7 +4,11 @@ export const serializeFormEntries = entries => export const serializeForm = form => { const fdata = new FormData(form); const entries = Array.from(fdata.keys()).map(key => { - const val = fdata.getAll(key); + let val = fdata.getAll(key); + // Microsoft Edge has a bug in FormData.getAll() that returns an undefined + // value for each form element that does not match the given key: + // https://github.com/jimmywarting/FormData/issues/80 + val = val.filter(n => n); return { name: key, value: val.length === 1 ? val[0] : val }; }); |