diff --git a/src/components/TableSettingsDialog/TableName.tsx b/src/components/TableSettingsDialog/TableName.tsx index 36875c11..1b6204a6 100644 --- a/src/components/TableSettingsDialog/TableName.tsx +++ b/src/components/TableSettingsDialog/TableName.tsx @@ -12,7 +12,7 @@ export interface ITableNameProps extends IShortTextComponentProps { export default function TableName({ watchedField, ...props }: ITableNameProps) { const { - field: { onChange, value }, + field: { onChange }, useFormMethods: { control }, disabled, } = props; @@ -25,12 +25,9 @@ export default function TableName({ watchedField, ...props }: ITableNameProps) { if (!touched && typeof watchedValue === "string" && !!watchedValue) { // if table name field is not touched, and watched value is valid, set table name to watched value onChange(startCase(watchedValue)); - } else if (typeof value === "string") { - // otherwise if table name is valid, set watched value to table name - onChange(startCase(value.trim())); } } - }, [watchedValue, disabled, onChange, value]); + }, [watchedValue, disabled]); return ; } diff --git a/src/components/TableSettingsDialog/form.tsx b/src/components/TableSettingsDialog/form.tsx index 31802e14..9d611e06 100644 --- a/src/components/TableSettingsDialog/form.tsx +++ b/src/components/TableSettingsDialog/form.tsx @@ -213,7 +213,7 @@ export const tableSettings = ( name: "name", label: "Table name", required: true, - watchedField: "name", + watchedField: "collection", assistiveText: "User-facing name for this table", autoFocus: true, gridCols: { xs: 12, sm: 6 },