Fix Firefox quick bar issue by allowing Ctrl+P to toggle modes (#7413)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Donnie 2020-10-21 05:19:16 -07:00 committed by GitHub
parent 3c4b0d4a74
commit bcf405bf9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,7 @@ export class QuickBar extends LitElement {
private _focusSet = false;
public async showDialog(params: QuickBarParams) {
this._commandMode = params.commandMode || false;
this._commandMode = params.commandMode || this._toggleIfAlreadyOpened();
this._commandItems = this._generateCommandItems();
this._entityItems = this._generateEntityItems();
this._opened = true;
@ -305,6 +305,10 @@ export class QuickBar extends LitElement {
.sort((a, b) => compare(a.text.toLowerCase(), b.text.toLowerCase()));
}
private _toggleIfAlreadyOpened() {
return this._opened ? !this._commandMode : false;
}
private _setFilteredItems() {
const items = this._commandMode ? this._commandItems : this._entityItems;
this._items = this._filter