From 10e31482b0f0d6ac5cd16dbbad59005b8faf6afe Mon Sep 17 00:00:00 2001 From: NixReaper Date: Sun, 5 Apr 2026 13:23:24 -0500 Subject: [PATCH] fix: setup wizard inputs losing focus on every keystroke StepContent was a component defined inside Setup, so every state change recreated it as a new component type, causing React to unmount/remount it and snap focus back to autoFocus. Replaced with inline conditional JSX blocks. --- nixserver/src/pages/Setup.tsx | 101 ++++++++++++++++------------------ 1 file changed, 46 insertions(+), 55 deletions(-) diff --git a/nixserver/src/pages/Setup.tsx b/nixserver/src/pages/Setup.tsx index 27e0311..09cd201 100644 --- a/nixserver/src/pages/Setup.tsx +++ b/nixserver/src/pages/Setup.tsx @@ -93,60 +93,6 @@ export default function Setup() { } } - // ── Step content ───────────────────────────────────────────────────────────── - function StepContent() { - if (step === 1) return ( - <> -

Server Identity

-

Set the fully-qualified hostname for this server.

- -

- Example: server.yourdomain.com -

- - ) - - if (step === 2) return ( - <> -

Nameservers

-

These nameservers will be used for hosted domains.

- -
- -
- - ) - - if (step === 3) return ( - <> -

Admin Account

-

Update your admin email and optionally set a new password.

- -
- -
-
- -
- - ) - - // Step 4 — Review - return ( - <> -

Review & Finish

-

Confirm your settings before applying them.

-
- - - - - -
- - ) - } - // ── Render ─────────────────────────────────────────────────────────────────── return (
@@ -190,7 +136,52 @@ export default function Setup() { {/* Card */}
- + + {/* Step 1 — Server Identity */} + {step === 1 && <> +

Server Identity

+

Set the fully-qualified hostname for this server.

+ +

+ Example: server.yourdomain.com +

+ } + + {/* Step 2 — Nameservers */} + {step === 2 && <> +

Nameservers

+

These nameservers will be used for hosted domains.

+ +
+ +
+ } + + {/* Step 3 — Admin Account */} + {step === 3 && <> +

Admin Account

+

Update your admin email and optionally set a new password.

+ +
+ +
+
+ +
+ } + + {/* Step 4 — Review */} + {step === 4 && <> +

Review & Finish

+

Confirm your settings before applying them.

+
+ + + + + +
+ } {error && (