mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: autocomplete: fix value is not a function
This commit is contained in:
2 files changed
+15
-2
No files matched your search
@@ -17,7 +17,14 @@ export default class AutoComplete extends DOMAttachedObject {
|
||||
...options,
|
||||
};
|
||||
this.ref = null;
|
||||
this.clear = this.clear.bind(this);
|
||||
this.onChange = this.onChange.bind(this);
|
||||
this.attach = this.attach.bind(this);
|
||||
this.open = this.open.bind(this);
|
||||
this.close = this.close.bind(this);
|
||||
this.value = this.value.bind(this);
|
||||
this.detach = this.detach.bind(this);
|
||||
this.focus = this.focus.bind(this);
|
||||
this.container = document.createElement('div');
|
||||
this.$dom.addClass('autocomplete-dummy').after(this.container);
|
||||
// Note: use `setTimeout(fn, 0)` to ensure that code is executed after browser autofill
|
||||
@@ -63,6 +70,10 @@ export default class AutoComplete extends DOMAttachedObject {
|
||||
this.ref.closeList();
|
||||
}
|
||||
|
||||
value() {
|
||||
return this.$dom.val();
|
||||
}
|
||||
|
||||
detach() {
|
||||
if (this.detached) return;
|
||||
super.detach();
|
||||
|
||||
Reference in new issue
Block a user