Skip to content

Commit

Permalink
fix map field reset & closed tabs bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Sep 3, 2024
1 parent 3ca3a01 commit 530c8de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ export const MapAndLabelProvider: React.FC<MapAndLabelProviderProps> = (
},
});

const [activeIndex, setActiveIndex] = useState<number>(
props.previouslySubmittedData ? -1 : 0,
);
const [activeIndex, setActiveIndex] = useState<number>(0);

const [minError, setMinError] = useState<boolean>(false);
const [maxError, setMaxError] = useState<boolean>(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const MapFieldInput: React.FC<Props<MapField>> = (props) => {
const editableFeatures = props.formik.values.schemaData?.[props.activeIndex]
?.features as Feature[];
const [features, setFeatures] = useState<Feature[] | undefined>(
editableFeatures.length > 0 ? editableFeatures : undefined,
editableFeatures?.length > 0 ? editableFeatures : undefined,
);

useEffect(() => {
Expand Down

0 comments on commit 530c8de

Please sign in to comment.