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:
@@ -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]">
|
||||
|
||||
Reference in New Issue
Block a user