summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 09:07:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-26 09:07:52 +0000
commit7e019504f5ac6decde690565857238e7e59aa034 (patch)
treefab8832b40e25fc9bc1ae54b9303b95ea146b5d5 /app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue
parent116d4e56e83a1f408afe710ce070e699ba206475 (diff)
downloadgitlab-ce-7e019504f5ac6decde690565857238e7e59aa034.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue
index 5e41a155ef6..78102caacf5 100644
--- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue
+++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/labels_select_root.vue
@@ -1,4 +1,5 @@
<script>
+import $ from 'jquery';
import Vue from 'vue';
import Vuex, { mapState, mapActions } from 'vuex';
import { __ } from '~/locale';
@@ -149,9 +150,16 @@ export default {
* the dropdown while dropdown is visible.
*/
handleDocumentClick({ target }) {
+ // This approach of element detection is needed
+ // as the dropdown wrapper is not using `GlDropdown` as
+ // it will also require us to use `BDropdownForm`
+ // which is yet to be implemented in GitLab UI.
if (
this.showDropdownButton &&
this.showDropdownContents &&
+ !$(target).parents('.js-btn-back').length &&
+ !$(target).parents('.js-labels-list').length &&
+ !target?.classList.contains('js-btn-cancel-create') &&
!target?.classList.contains('js-sidebar-dropdown-toggle') &&
!this.$refs.dropdownButtonCollapsed?.$el.contains(target) &&
!this.$refs.dropdownContents?.$el.contains(target)