mirror of
https://github.com/netbirdio/IronRDP.git
synced 2026-05-22 18:43:12 -07:00
fix(web): re-introduce shadow root but also delegate focus (#717)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user