import { dispatchUpdate } from "../state/store"; export function applyActiveElement(host: HTMLElement): void { host.onmousedown = function (event) { if ((event.target as HTMLElement).tagName != 'OL-PROVIDER') { dispatchUpdate("activeElement", event.target as HTMLElement); } }; const iframes = document.querySelectorAll("iframe"); iframes.forEach((frame) => { // Handle waterfall loading frame.contentWindow?.addEventListener('mousedown', (event) => { if ((event.target as HTMLElement).tagName != 'OL-PROVIDER') { dispatchUpdate("activeElement", event.target as HTMLElement); } }); }) }