mirror of
https://github.com/frappe/books.git
synced 2024-12-23 19:39:07 +00:00
feat: allow aribitrary values in AutoComplete
- pass doc to getList
This commit is contained in:
parent
50a71749ee
commit
497872eb84
@ -59,6 +59,9 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
inject: {
|
||||||
|
doc: { default: null },
|
||||||
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
methods: {
|
||||||
async updateSuggestions(e) {
|
async updateSuggestions(e) {
|
||||||
@ -81,7 +84,7 @@ export default {
|
|||||||
keyword = keyword.toLowerCase();
|
keyword = keyword.toLowerCase();
|
||||||
|
|
||||||
let list = this.df.getList
|
let list = this.df.getList
|
||||||
? await this.df.getList()
|
? await this.df.getList(this.doc)
|
||||||
: this.df.options || [];
|
: this.df.options || [];
|
||||||
|
|
||||||
let items = list.map((d) => {
|
let items = list.map((d) => {
|
||||||
@ -118,6 +121,12 @@ export default {
|
|||||||
async onBlur(value) {
|
async onBlur(value) {
|
||||||
if (value === '' || value == null) {
|
if (value === '' || value == null) {
|
||||||
this.triggerChange('');
|
this.triggerChange('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value && this.suggestions.length === 0) {
|
||||||
|
this.triggerChange(value);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user