mirror of
https://github.com/coder/coder.git
synced 2025-03-14 10:09:57 +00:00
fix: allow reselecting the same preset b
y ensuring useEffect runs on selection
This commit is contained in:
@ -291,6 +291,11 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
|
|||||||
const newIndex = presetOptions.findIndex(
|
const newIndex = presetOptions.findIndex(
|
||||||
(preset) => preset.value === option?.value,
|
(preset) => preset.value === option?.value,
|
||||||
);
|
);
|
||||||
|
setSelectedPresetIndex(newIndex);
|
||||||
|
form.setFieldValue(
|
||||||
|
"template_version_preset_id",
|
||||||
|
option?.value,
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
placeholder="Select a preset"
|
placeholder="Select a preset"
|
||||||
selectedOption={presetOptions[selectedPresetIndex]}
|
selectedOption={presetOptions[selectedPresetIndex]}
|
||||||
|
Reference in New Issue
Block a user