diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-22 18:10:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-22 18:10:52 +0300 |
commit | b52aefb5996cdd22dc969161d414244a59046e6e (patch) | |
tree | 9b1e3fe92ababfcc3110dca0380727a593220bd4 /app/assets/javascripts/sidebar | |
parent | 4fc46d75644b28789e83c95ec4d1309498bb4ba3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sidebar')
-rw-r--r-- | app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue index 19fe78aca87..d8d07b4b221 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/dropdown_contents_labels_view.vue @@ -135,6 +135,16 @@ export default { this.handleLabelClick(this.visibleLabels[0]); } }, + handleFocus(event, index) { + if (index === 0 && event.target.classList.contains('is-focused')) { + event.target.classList.remove('is-focused'); + + // Focus next element (if available) as the first item was already focused. + if (event.target.parentNode?.nextElementSibling?.querySelector('button')) { + event.target.parentNode.nextElementSibling.querySelector('button').focus(); + } + } + }, }, }; </script> @@ -157,6 +167,7 @@ export default { :active="shouldHighlightFirstItem && index === 0" active-class="is-focused" data-testid="labels-list" + @focus.native.capture="handleFocus($event, index)" @click.native.capture.stop="handleLabelClick(label)" > <label-item :label="label" /> |