2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-16 09:10:33 +03:00

fix: create option not being called (#1158)

Closes #1156
This commit is contained in:
Jeff Sagal
2020-04-12 12:36:19 -07:00
committed by GitHub
parent 142a639444
commit f0e669c022
6 changed files with 88 additions and 35 deletions
+17
View File
@@ -16,6 +16,23 @@ export const searchSubmit = (Wrapper, searchText = false) => {
Wrapper.find({ ref: "search" }).trigger("keydown.enter")
};
/**
* Focus the input, enter some search text, hit return.
* @param Wrapper {Wrapper<Vue>}
* @param searchText
* @return {Promise<void>}
*/
export const selectTag = async (Wrapper, searchText) => {
Wrapper.vm.$refs.search.focus();
await Wrapper.vm.$nextTick();
Wrapper.vm.search = searchText;
await Wrapper.vm.$nextTick();
Wrapper.find({ ref: "search" }).trigger("keydown.enter");
await Wrapper.vm.$nextTick();
};
/**
* Create a new VueSelect instance with
* a provided set of props.