fix(web): prevent state_unsafe_mutation error on people page (#26438)

This commit is contained in:
Michel Heusschen
2026-02-23 13:24:51 +01:00
committed by GitHub
parent 31a55aaa73
commit 1bd28c3e78

View File

@@ -1,3 +1,5 @@
import { on } from 'svelte/events';
interface Options {
onFocusOut?: (event: FocusEvent) => void;
}
@@ -19,11 +21,11 @@ export function focusOutside(node: HTMLElement, options: Options = {}) {
}
};
node.addEventListener('focusout', handleFocusOut);
const off = on(node, 'focusout', handleFocusOut);
return {
destroy() {
node.removeEventListener('focusout', handleFocusOut);
off();
},
};
}