From 3b47f463d1beca5ef59f88ff631a2ce0d7327e9a Mon Sep 17 00:00:00 2001 From: E44 <129310925+programmer-44@users.noreply.github.com> Date: Sun, 9 Nov 2025 18:58:14 +0100 Subject: [PATCH] fix button state warning --- control/frontend/src/components/Button.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/control/frontend/src/components/Button.svelte b/control/frontend/src/components/Button.svelte index 137622b..c5e5d5a 100644 --- a/control/frontend/src/components/Button.svelte +++ b/control/frontend/src/components/Button.svelte @@ -26,13 +26,13 @@ click_function?: (e: MouseEvent) => void; menu_options?: MenuOption[] | null; menu_class?: string; - div_class?: string, + div_class?: string; children?: any; }>(); let menu_shown = $state(false); let button_element: HTMLButtonElement; - let menu_element: HTMLDivElement; + let menu_element: HTMLDivElement | null = $state(null); let position_bottom = $state(true); function onclick(e: MouseEvent) { @@ -47,7 +47,7 @@ } function getPolygon(): [number, number][] | null { - if (!button_element || !button_element) return null; + if (!button_element || !menu_element) return null; const b = button_element.getBoundingClientRect(); const m = menu_element.getBoundingClientRect();