mirror of
https://github.com/immich-app/immich.git
synced 2026-03-03 02:57:01 +00:00
fix(web): prevent state_unsafe_mutation error on people page (#26438)
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import { on } from 'svelte/events';
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
onFocusOut?: (event: FocusEvent) => void;
|
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 {
|
return {
|
||||||
destroy() {
|
destroy() {
|
||||||
node.removeEventListener('focusout', handleFocusOut);
|
off();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user