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