diff options
author | Phil Hughes <me@iamphill.com> | 2018-02-27 16:21:28 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-02-27 16:21:28 +0000 |
commit | 566dc70b5059c56fd46dd0461977960d5ee0fdf3 (patch) | |
tree | c83bb34a32aafb914cf8ea1d52614167ac58d3d8 /app | |
parent | 7d12f3a84e39c6be6f3798e37b39f0023ece71ec (diff) | |
parent | 13a7fde703ea820ce5649bb549aac4f8a3d8b560 (diff) | |
download | gitlab-ce-566dc70b5059c56fd46dd0461977960d5ee0fdf3.tar.gz |
Merge branch '24774-clear-the-Labels-dropdown-search-filter' into 'master'
Clear "Labels" dropdown search filter after selection
Closes #24774
See merge request gitlab-org/gitlab-ce!17393
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/labels_select.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index 7151ac05a09..89a246f56cf 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -242,10 +242,16 @@ export default class LabelsSelect { filterable: true, selected: $dropdown.data('selected') || [], toggleLabel: function(selected, el) { + var $dropdownParent = $dropdown.parent(); + var $dropdownInputField = $dropdownParent.find('.dropdown-input-field'); var isSelected = el !== null ? el.hasClass('is-active') : false; var title = selected.title; var selectedLabels = this.selected; + if ($dropdownInputField.length && $dropdownInputField.val().length) { + $dropdownParent.find('.dropdown-input-clear').trigger('click'); + } + if (selected.id === 0) { this.selected = []; return 'No Label'; |