fix(web): re-introduce shadow root but also delegate focus (#717)

This commit is contained in:
irvingouj@Devolutions
2025-03-24 17:55:39 -04:00
committed by GitHub
parent b72e0857bf
commit 248588371a
@@ -1,4 +1,17 @@
<svelte:options customElement={{ tag: 'iron-remote-gui', shadow: 'none' }} />
<svelte:options
customElement={{
tag: 'iron-remote-gui',
shadow: 'none',
extend: (elementConstructor) => {
return class extends elementConstructor {
constructor() {
super();
this.attachShadow({ mode: 'open', delegatesFocus: true });
}
};
},
}}
/>
<script lang="ts">
import { onMount } from 'svelte';
@@ -28,8 +41,7 @@
capturingInputs: ${document.activeElement === canvas}
current active element: ${document.activeElement}
`);
return document.activeElement === canvas;
return document.activeElement?.shadowRoot?.firstElementChild === inner;
};
let inner: HTMLDivElement;