fix: replicas not update after cancel

main
jialin 1 year ago
parent e1ada8f53d
commit 2cd676fd3d

@ -14,7 +14,7 @@ const isProduction = env === 'production';
const t = Date.now();
export default defineConfig({
proxy: {
...proxy('http://192.168.50.166:8080')
...proxy()
},
history: {
type: 'hash'

@ -2,7 +2,7 @@ import { CheckOutlined, FormOutlined, UndoOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, Input, InputNumber, Tooltip } from 'antd';
import classNames from 'classnames';
import React, { useContext } from 'react';
import React, { useContext, useEffect } from 'react';
import RowContext from '../row-context';
import '../styles/cell.less';
import { SealColumnProps } from '../types';
@ -35,6 +35,12 @@ const SealColumn: React.FC<SealColumnProps> = (props) => {
setCurrent(cachedValue.current);
setIsEditing(false);
};
useEffect(() => {
if (editable) {
cachedValue.current = row[dataIndex];
setCurrent(row[dataIndex]);
}
}, [row[dataIndex], editable]);
const renderContent = () => {
if (isEditing && editable) {

Loading…
Cancel
Save