Commit 143512cb authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch 'revert-5e6413e3' into 'master'

Revert MR for autofocuseing label

See merge request gitlab-org/gitlab!78363
parents 7b7d26c5 29549124
...@@ -84,14 +84,6 @@ export default { ...@@ -84,14 +84,6 @@ export default {
showNoMatchingResultsMessage() { showNoMatchingResultsMessage() {
return Boolean(this.searchKey) && this.visibleLabels.length === 0; 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: { methods: {
isLabelSelected(label) { isLabelSelected(label) {
...@@ -151,14 +143,11 @@ export default { ...@@ -151,14 +143,11 @@ export default {
/> />
<template v-else> <template v-else>
<gl-dropdown-item <gl-dropdown-item
v-for="(label, index) in visibleLabels" v-for="label in visibleLabels"
ref="labelItem"
:key="label.id" :key="label.id"
:is-checked="isLabelSelected(label)" :is-checked="isLabelSelected(label)"
:is-check-centered="true" :is-check-centered="true"
:is-check-item="true" :is-check-item="true"
:active="shouldHighlighFirstItem && index === 0"
active-class="is-focused"
data-testid="labels-list" data-testid="labels-list"
@click.native.capture.stop="handleLabelClick(label)" @click.native.capture.stop="handleLabelClick(label)"
> >
......
...@@ -110,19 +110,6 @@ describe('DropdownContentsLabelsView', () => { ...@@ -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 () => { it('when search returns 0 results', async () => {
createComponent({ createComponent({
queryHandler: jest.fn().mockResolvedValue({ 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