diff --git a/client/desk/formmodal.js b/client/desk/formmodal.js index 52d8624c..ed2883a7 100644 --- a/client/desk/formmodal.js +++ b/client/desk/formmodal.js @@ -44,4 +44,4 @@ module.exports = class FormModal extends Modal { } } -} \ No newline at end of file +} diff --git a/ui/components/controls/Autocomplete.vue b/ui/components/controls/Autocomplete.vue index 2f4b318b..765474de 100644 --- a/ui/components/controls/Autocomplete.vue +++ b/ui/components/controls/Autocomplete.vue @@ -17,15 +17,23 @@ export default { methods: { getInputListeners() { return { - input: async e => { - this.awesomplete.list = await this.getList(e.target.value); + input: e => { + this.updateList(e.target.value); }, 'awesomplete-select': e => { const value = e.text.value; this.handleChange(value); + }, + focus: async e => { + await this.updateList(); + this.awesomplete.evaluate(); + this.awesomplete.open(); } } }, + async updateList(value) { + this.awesomplete.list = await this.getList(value); + }, getList(text) { return this.docfield.getList(text); }, @@ -46,11 +54,9 @@ export default { return li; } }); - this.bindEvents(); }, bindEvents() { - }, sort() { // return a function that handles sorting of items diff --git a/ui/components/controls/Link.vue b/ui/components/controls/Link.vue index f4bb1183..bcdc74df 100644 --- a/ui/components/controls/Link.vue +++ b/ui/components/controls/Link.vue @@ -18,9 +18,9 @@ export default { async getList(query) { const list = await frappe.db.getAll({ doctype: this.getTarget(), - filters: { + filters: query ? { keywords: ['like', query] - }, + } : null, fields: ['name'], limit: 50 });