This commit is contained in:
2025-07-14 18:14:40 +00:00
parent 01dad7cc5e
commit 5e25f86a0b
2 changed files with 25 additions and 9 deletions

View File

@@ -260,14 +260,26 @@ export class SioFab extends DeesElement {
public async firstUpdated(args: any) {
super.firstUpdated(args);
const domtools = await this.domtoolsPromise;
const sioCombox: SioCombox = this.shadowRoot.querySelector('sio-combox');
const mainBox: HTMLElement = this.shadowRoot.querySelector('#mainbox');
sioCombox.referenceObject = mainBox;
// Set up keyboard shortcut
domtools.keyboard
.on([domtools.keyboard.keyEnum.Ctrl, domtools.keyboard.keyEnum.S])
.subscribe(() => {
this.toggleCombox();
});
}
public async updated(changedProperties: Map<string | number | symbol, unknown>) {
await super.updated(changedProperties);
// Set reference object when combox is rendered
if ((changedProperties.has('showCombox') || changedProperties.has('hasShownOnce')) &&
(this.showCombox || this.hasShownOnce)) {
const sioCombox: SioCombox = this.shadowRoot.querySelector('sio-combox');
const mainBox: HTMLElement = this.shadowRoot.querySelector('#mainbox');
if (sioCombox && mainBox && !sioCombox.referenceObject) {
sioCombox.referenceObject = mainBox;
}
}
}
}