Compare commits

..

2 Commits

Author SHA1 Message Date
PotapovaA
bc4e5122c6 Merge branch 'front-projects' of https://git.aepif.ru/RSHB/DFiP_Budget_planing into front-projects 2026-07-03 13:27:51 +03:00
PotapovaA
acd4645a4e fix aurora-1149 2026-07-03 12:46:05 +03:00
2 changed files with 5 additions and 12 deletions

View File

@ -72,7 +72,6 @@ const EditCell = ({ refCell, onChange, disabled, value, tableId, cellId, table }
if (isFormula(curValue)) {
// Сохраняем формулу в localStorage
saveToStorage(storageKey, curValue);
// Вычисляем и сохраняем результат
try {
const formula = extractFormula(curValue);
@ -112,6 +111,9 @@ const EditCell = ({ refCell, onChange, disabled, value, tableId, cellId, table }
};
const finishEditing = () => {
if (!disabled) {
handleSave();
}
const editingCell = table.getState().editingCell || null;
if (editingCell) {
contextEndEditing?.(editingCell.row, editingCell.column);
@ -132,7 +134,7 @@ const EditCell = ({ refCell, onChange, disabled, value, tableId, cellId, table }
return () => {
document.removeEventListener('mousedown', handleClickOutside);
};
}, [ref]);
}, [ref, finishEditing]);
return (
<tr>
@ -176,16 +178,10 @@ const EditCell = ({ refCell, onChange, disabled, value, tableId, cellId, table }
}}
onChange={handleChangeValue}
value={curValue}
onBlur={handleSave}
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
handleSave();
// Закрываем редактирование
if (onChange) {
// Симулируем завершение редактирования
document.activeElement?.blur();
}
finishEditing();
}
}}
placeholder={isFormulaMode ? 'Введите формулу (начинается с =)' : ''}

View File

@ -63,7 +63,6 @@ const RealtimeTable = ({ formType, formId, sheetName, direction, year }) => {
addRow: contextAddRow,
deleteRow: contextDeleteRow,
startEditing: contextStartEditing,
endEditing: contextEndEditing,
} = useRealtime();
const {
@ -181,8 +180,6 @@ const RealtimeTable = ({ formType, formId, sheetName, direction, year }) => {
if (cell) {
if (editingCell) return;
contextStartEditing?.(cell.row, cell.column);
} else {
contextEndEditing?.(editingCell.row, editingCell.column);
}
},
columnVirtualizerOptions: ({ table }) => ({