mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +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}
|
||||
}
|
||||
|
||||
this.$emit('option:created', newOption)
|
||||
this.$emit('option:created', newOption, this)
|
||||
return newOption
|
||||
}
|
||||
},
|
||||
@@ -701,7 +701,7 @@
|
||||
*/
|
||||
closeSearchOptions(){
|
||||
this.open = false
|
||||
this.$emit('search:blur')
|
||||
this.$emit('search:blur', this)
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -802,7 +802,7 @@
|
||||
*/
|
||||
onSearchFocus() {
|
||||
this.open = true
|
||||
this.$emit('search:focus')
|
||||
this.$emit('search:focus', this)
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,7 +86,7 @@ describe("Toggling Dropdown", () => {
|
||||
Select.vm.onSearchBlur();
|
||||
|
||||
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", () => {
|
||||
@@ -96,7 +96,7 @@ describe("Toggling Dropdown", () => {
|
||||
Select.vm.onSearchFocus();
|
||||
|
||||
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", () => {
|
||||
|
||||
Reference in New Issue
Block a user