mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
close autocomplete when removing auto-completed part
This commit is contained in:
parent
e0b99b5cc8
commit
713205e0ab
1 changed files with 6 additions and 2 deletions
|
@ -90,10 +90,14 @@ export default class EditorModel {
|
|||
|
||||
_removePart(index) {
|
||||
this._parts.splice(index, 1);
|
||||
if (this._activePartIdx >= index) {
|
||||
if (index === this._activePartIdx) {
|
||||
this._activePartIdx = null;
|
||||
} else if (this._activePartIdx > index) {
|
||||
--this._activePartIdx;
|
||||
}
|
||||
if (this._autoCompletePartIdx >= index) {
|
||||
if (index === this._autoCompletePartIdx) {
|
||||
this._autoCompletePartIdx = null;
|
||||
} else if (this._autoCompletePartIdx > index) {
|
||||
--this._autoCompletePartIdx;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue