diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-12-15 23:08:49 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-09 16:01:31 -0600 |
commit | d19303cbe1e9813f5fe2409908c7f89616ec5eac (patch) | |
tree | 8fb4782fd8054d71d11a6ce695635df9ef83529f /app | |
parent | 98189f37c94a6c97d7420e66deb25a000ee65afc (diff) | |
download | gitlab-ce-d19303cbe1e9813f5fe2409908c7f89616ec5eac.tar.gz |
Fix dropdown hint reset when changing tabs
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_hint.js.es6 | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_hint.js.es6 b/app/assets/javascripts/filtered_search/dropdown_hint.js.es6 index 34079b25846..b9f552b62b9 100644 --- a/app/assets/javascripts/filtered_search/dropdown_hint.js.es6 +++ b/app/assets/javascripts/filtered_search/dropdown_hint.js.es6 @@ -59,7 +59,15 @@ renderContent() { this.droplab.changeHookList(this.hookId, this.dropdown, [droplabFilter], this.config); - this.droplab.setData(this.hookId, dropdownData); + + // Clone dropdownData to prevent it from being + // changed due to pass by reference + const data = []; + dropdownData.forEach((item) => { + data.push(Object.assign({}, item)); + }); + + this.droplab.setData(this.hookId, data); } init() { |