Commit c54d7b6b authored by Justin Ho's avatar Justin Ho

Automatically open dropdown when toggling

When the sidebar is collapsed and the user clicks on
the Labels button, the sidebar will now automatically
expand and show the labels dropdown.

This is consistent with how other fields like status work.
parent 85934c49
......@@ -56,6 +56,11 @@ export default {
default: () => [],
},
},
data() {
return {
isEditingLabels: false,
};
},
computed: {
assignee() {
// Jira issues have at most 1 assignee
......@@ -104,6 +109,19 @@ export default {
);
}
},
onIssueLabelsClose() {
this.isEditingLabels = false;
},
onIssueLabelsToggle() {
this.expandSidebarAndOpenDropdown();
this.sidebarEl.addEventListener(
'transitionend',
() => {
this.isEditingLabels = true;
},
{ once: true },
);
},
onIssueLabelsUpdated(labels) {
this.$emit('issue-labels-updated', labels);
},
......@@ -143,8 +161,11 @@ export default {
:labels-filter-base-path="issuesListPath"
:labels-filter-param="$options.labelsFilterParam"
:labels-select-in-progress="isUpdatingLabels"
:is-editing="isEditingLabels"
variant="sidebar"
class="block labels js-labels-block"
@onDropdownClose="onIssueLabelsClose"
@toggleCollapse="onIssueLabelsToggle"
@updateSelectedLabels="onIssueLabelsUpdated"
>
{{ __('None') }}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment