summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorKushal Pandya <kushal@gitlab.com>2018-02-27 17:13:04 +0530
committerKushal Pandya <kushal@gitlab.com>2018-02-27 17:13:04 +0530
commit9ca1a641911bf34e3f3342e9bb11a42126fcc6be (patch)
treec30109ebc54a5c527ca8aefe828591487ea13130 /app/assets
parentb53256559fbb8cc078cc16754e9bf34dbee09746 (diff)
downloadgitlab-ce-9ca1a641911bf34e3f3342e9bb11a42126fcc6be.tar.gz
Clear "Labels" dropdown search filter after selection
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/labels_select.js6
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';