Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
pr feedback
  • Loading branch information
mabaasit committed Dec 12, 2025
commit a7e31131612f19db0e3d7beb3a5d19b339a144cf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useState } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import { connect } from 'react-redux';
import type {
FieldPath,
Expand Down Expand Up @@ -131,6 +131,9 @@ const FieldDrawerContent: React.FunctionComponent<FieldDrawerContentProps> = ({
string | undefined
>();
const [fieldTypes, setFieldTypes] = useState<string[]>(types);
useEffect(() => {
setFieldTypes(types);
}, [types]);

const { value: fieldName, ...nameInputProps } = useChangeOnBlur(
fieldPath[fieldPath.length - 1],
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-data-modeling/src/store/diagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,8 @@ export function changeFieldType({
jsonSchema: collectionSchema,
fieldPath: fieldPath,
});
const oldTypes = field?.fieldTypes;
if (!field) throw new Error('Field not found in schema');
const oldTypes = field.fieldTypes;
const to = getSchemaWithNewTypes(field.jsonSchema, newTypes);

track('Data Modeling Field Type Changed', {
Expand Down
Loading