Improve autocomplete
This commit is contained in:
parent
46b0c5f354
commit
958c59b065
2 changed files with 82 additions and 40 deletions
|
|
@ -99,6 +99,9 @@ class Autocomplete {
|
|||
if (username != '' && username.match(/^[a-zA-Z0-9_]+$/)) {
|
||||
this.open('user', username);
|
||||
opened = true;
|
||||
} else if (username === '') {
|
||||
this.open('user', null);
|
||||
opened = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +129,7 @@ class Autocomplete {
|
|||
/**
|
||||
* サジェストを提示します。
|
||||
*/
|
||||
private async open(type, q) {
|
||||
private async open(type: string, q: string) {
|
||||
if (type != this.currentType) {
|
||||
this.close();
|
||||
}
|
||||
|
|
@ -144,6 +147,7 @@ class Autocomplete {
|
|||
//#endregion
|
||||
|
||||
if (this.suggestion) {
|
||||
// TODO: Vueの警告が出るのでなんとかする
|
||||
this.suggestion.x = x;
|
||||
this.suggestion.y = y;
|
||||
this.suggestion.q = q;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue