mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 23:36:36 +00:00
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:
parent
3c4b0d4a74
commit
bcf405bf9d
@ -68,7 +68,7 @@ export class QuickBar extends LitElement {
|
|||||||
private _focusSet = false;
|
private _focusSet = false;
|
||||||
|
|
||||||
public async showDialog(params: QuickBarParams) {
|
public async showDialog(params: QuickBarParams) {
|
||||||
this._commandMode = params.commandMode || false;
|
this._commandMode = params.commandMode || this._toggleIfAlreadyOpened();
|
||||||
this._commandItems = this._generateCommandItems();
|
this._commandItems = this._generateCommandItems();
|
||||||
this._entityItems = this._generateEntityItems();
|
this._entityItems = this._generateEntityItems();
|
||||||
this._opened = true;
|
this._opened = true;
|
||||||
@ -305,6 +305,10 @@ export class QuickBar extends LitElement {
|
|||||||
.sort((a, b) => compare(a.text.toLowerCase(), b.text.toLowerCase()));
|
.sort((a, b) => compare(a.text.toLowerCase(), b.text.toLowerCase()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _toggleIfAlreadyOpened() {
|
||||||
|
return this._opened ? !this._commandMode : false;
|
||||||
|
}
|
||||||
|
|
||||||
private _setFilteredItems() {
|
private _setFilteredItems() {
|
||||||
const items = this._commandMode ? this._commandItems : this._entityItems;
|
const items = this._commandMode ? this._commandItems : this._entityItems;
|
||||||
this._items = this._filter
|
this._items = this._filter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user