fix: Ensure template type is loaded before rendering Select

Addresses #242. The Select component renders with value={undefined}
before useEffect populates editedTemplate.type. This triggers a React
warning: 'Select is changing from uncontrolled to controlled.'

On the hosted environment, this likely causes Radix UI's data-placeholder
attribute to remain set on the trigger, with the selected value text
not being rendered despite the value being loaded in state.

This change extends the loading condition to wait for editedTemplate.type,
ensuring the Select never renders in an undefined/uncontrolled state.
This commit is contained in:
Jan Behrends
2026-01-16 13:09:14 +01:00
parent 3a16ad3221
commit 8a38766c02
+1 -1
View File
@@ -118,7 +118,7 @@ export default function TemplateEditorPage() {
}
};
if (!template) {
if (!template || !editedTemplate.type) {
return (
<DashboardLayout>
<div className="flex items-center justify-center min-h-[400px]">