Commit 1d327469 authored by NataliaTepluhina's avatar NataliaTepluhina Committed by Natalia Tepluhina

Fixed an event for focus

Changelog: changed
parent 84917c8c
......@@ -173,6 +173,9 @@ export default {
this.$refs.dropdown.show();
},
clearSearch() {
if (!this.allowMultiselect || this.isStandalone) {
return;
}
this.searchKey = '';
this.setFocus();
},
......@@ -214,7 +217,7 @@ export default {
:attr-workspace-path="attrWorkspacePath"
:label-create-type="labelCreateType"
@hideCreateView="toggleDropdownContent"
@selectLabel="clearSearch"
@input="clearSearch"
/>
</template>
<template #footer>
......
......@@ -121,7 +121,6 @@ export default {
},
handleLabelClick(label) {
this.updateSelectedLabels(label);
this.$emit('selectLabel');
if (!this.allowMultiselect) {
this.$emit('closeDropdown', this.localSelectedLabels);
}
......
......@@ -156,7 +156,7 @@ describe('DropdownContent', () => {
it('clears and focuses search input on selecting a label', () => {
createComponent();
findDropdownHeader().vm.$emit('input', '123');
findLabelsView().vm.$emit('selectLabel');
findLabelsView().vm.$emit('input', []);
expect(findLabelsView().props('searchKey')).toBe('');
expect(focusInput).toHaveBeenCalled();
......
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