mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
add this to all events except input event – still need a solution for emitting input event
This commit is contained in:
@@ -390,7 +390,7 @@
|
|||||||
newOption = {[this.label]: newOption}
|
newOption = {[this.label]: newOption}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('option:created', newOption)
|
this.$emit('option:created', newOption, this)
|
||||||
return newOption
|
return newOption
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -701,7 +701,7 @@
|
|||||||
*/
|
*/
|
||||||
closeSearchOptions(){
|
closeSearchOptions(){
|
||||||
this.open = false
|
this.open = false
|
||||||
this.$emit('search:blur')
|
this.$emit('search:blur', this)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -802,7 +802,7 @@
|
|||||||
*/
|
*/
|
||||||
onSearchFocus() {
|
onSearchFocus() {
|
||||||
this.open = true
|
this.open = true
|
||||||
this.$emit('search:focus')
|
this.$emit('search:focus', this)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ describe("Toggling Dropdown", () => {
|
|||||||
Select.vm.onSearchBlur();
|
Select.vm.onSearchBlur();
|
||||||
|
|
||||||
expect(Select.vm.open).toEqual(false);
|
expect(Select.vm.open).toEqual(false);
|
||||||
expect(spy).toHaveBeenCalledWith("search:blur");
|
expect(spy).toHaveBeenCalledWith("search:blur", Select.vm);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("will open the dropdown and emit the search:focus event from onSearchFocus", () => {
|
it("will open the dropdown and emit the search:focus event from onSearchFocus", () => {
|
||||||
@@ -96,7 +96,7 @@ describe("Toggling Dropdown", () => {
|
|||||||
Select.vm.onSearchFocus();
|
Select.vm.onSearchFocus();
|
||||||
|
|
||||||
expect(Select.vm.open).toEqual(true);
|
expect(Select.vm.open).toEqual(true);
|
||||||
expect(spy).toHaveBeenCalledWith("search:focus");
|
expect(spy).toHaveBeenCalledWith("search:focus", Select.vm);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("will close the dropdown on escape, if search is empty", () => {
|
it("will close the dropdown on escape, if search is empty", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user