diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditRow.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditRow.tsx index ae1783a4a2..88aa2563c9 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditRow.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditRow.tsx @@ -78,6 +78,9 @@ export const EditRow = ({ const typeOptionController = new TypeOptionController(viewId, Some(currentField)); await typeOptionController.switchToField(newType); + + setEditingCell(new CellIdentifier(viewId, rowInfo.row.id, editingCell.fieldId, newType)); + setShowChangeFieldTypePopup(false); }; diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useRow.ts b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useRow.ts index 8f634009ff..30c3c1f7be 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useRow.ts +++ b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/database-hooks/useRow.ts @@ -5,10 +5,12 @@ import { CellIdentifier } from '$app/stores/effects/database/cell/cell_bd_svc'; import { useEffect, useState } from 'react'; import { TypeOptionController } from '$app/stores/effects/database/field/type_option/type_option_controller'; import { None } from 'ts-results'; +import { useAppSelector } from '$app/stores/store'; export const useRow = (viewId: string, databaseController: DatabaseController, rowInfo: RowInfo) => { const [cells, setCells] = useState<{ fieldId: string; cellIdentifier: CellIdentifier }[]>([]); const [rowController, setRowController] = useState(); + const databaseStore = useAppSelector((state) => state.database); useEffect(() => { if (!databaseController || !rowInfo) return; @@ -38,7 +40,7 @@ export const useRow = (viewId: string, databaseController: DatabaseController, r setCells(loadingCells); })(); - }, [rowController]); + }, [rowController, databaseStore.columns]); const onNewColumnClick = async () => { if (!databaseController) return;