open処理中はopenの処理をしないように (#3661)

* autocomplettimeout

* fix

* fix

* Update autocomplete.ts

* Update autocomplete.ts
This commit is contained in:
tamaina 2018-12-20 00:02:28 +09:00 committed by syuilo
parent c03e2dfbc0
commit d059d7f972
1 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class Autocomplete {
private opts: { private opts: {
model: string; model: string;
}; };
private opening: boolean;
private get text(): string { private get text(): string {
return this.vm[this.opts.model]; return this.vm[this.opts.model];
@ -48,6 +49,7 @@ class Autocomplete {
this.textarea = textarea; this.textarea = textarea;
this.vm = vm; this.vm = vm;
this.opts = opts; this.opts = opts;
this.opening = false;
} }
/** /**
@ -128,6 +130,8 @@ class Autocomplete {
if (type != this.currentType) { if (type != this.currentType) {
this.close(); this.close();
} }
if (this.opening) return;
this.opening = true;
this.currentType = type; this.currentType = type;
//#region サジェストを表示すべき位置を計算 //#region サジェストを表示すべき位置を計算
@ -143,6 +147,8 @@ class Autocomplete {
this.suggestion.x = x; this.suggestion.x = x;
this.suggestion.y = y; this.suggestion.y = y;
this.suggestion.q = q; this.suggestion.q = q;
this.opening = false;
} else { } else {
const MkAutocomplete = await import('../components/autocomplete.vue').then(m => m.default); const MkAutocomplete = await import('../components/autocomplete.vue').then(m => m.default);
@ -162,6 +168,8 @@ class Autocomplete {
// 要素追加 // 要素追加
document.body.appendChild(this.suggestion.$el); document.body.appendChild(this.suggestion.$el);
this.opening = false;
} }
} }