Commit 29549124 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Revert "Merge branch '350312-labels-widget-auto-select-first-label-when-searching' into 'master'"

This reverts merge request !78246
parent aed836d7
......@@ -84,14 +84,6 @@ export default {
showNoMatchingResultsMessage() {
return Boolean(this.searchKey) && this.visibleLabels.length === 0;
},
shouldHighlighFirstItem() {
return this.searchKey !== '' && this.visibleLabels.length > 0;
},
},
updated() {
if (this.shouldHighlighFirstItem) {
this.$refs.labelItem[0]?.$el?.firstChild?.focus();
}
},
methods: {
isLabelSelected(label) {
......@@ -151,14 +143,11 @@ export default {
/>
<template v-else>
<gl-dropdown-item
v-for="(label, index) in visibleLabels"
ref="labelItem"
v-for="label in visibleLabels"
:key="label.id"
:is-checked="isLabelSelected(label)"
:is-check-centered="true"
:is-check-item="true"
:active="shouldHighlighFirstItem && index === 0"
active-class="is-focused"
data-testid="labels-list"
@click.native.capture.stop="handleLabelClick(label)"
>
......
......@@ -110,19 +110,6 @@ describe('DropdownContentsLabelsView', () => {
});
});
it('first item is active when search is not empty', async () => {
createComponent({
queryHandler: jest.fn().mockResolvedValue(workspaceLabelsQueryResponse),
searchKey: 'Label',
});
await makeObserverAppear();
await waitForPromises();
await nextTick();
expect(findLabelsList().exists()).toBe(true);
expect(findFirstLabel().attributes('active')).toBe('true');
});
it('when search returns 0 results', async () => {
createComponent({
queryHandler: jest.fn().mockResolvedValue({
......
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