fixes:have to select the selected version again to create a new

This commit is contained in:
arpitnath 2023-10-03 16:35:41 +05:30
parent a587b9bead
commit dea8549548

View file

@ -30,8 +30,8 @@ export const CreateVersion = ({
return { label: version.name, value: version };
});
const [selectedVersion, setSelectedVersion] = useState(() =>
options.find((option) => option?.value?.id === editingVersion?.id)
const [selectedVersion, setSelectedVersion] = useState(
() => options.find((option) => option?.value?.id === editingVersion?.id)?.value
);
const createVersion = () => {
@ -114,7 +114,7 @@ export const CreateVersion = ({
<div className="ts-control" data-cy="create-version-from-input-field">
<Select
options={options}
defaultValue={selectedVersion}
value={selectedVersion}
onChange={(version) => {
setSelectedVersion(version);
}}