ant-design / pro-components

πŸ† Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.02k stars 1.28k forks source link

πŸ›[BUG] EditableProTable timeRange value resets after selecting both values and clicking Ok button #8213

Open erdemkeren opened 1 month ago

erdemkeren commented 1 month ago

πŸ› bug 描述

EditableProTable timeRange value resets after selecting both values and clicking Ok button

πŸ“· 倍现ζ­₯ιͺ€

🏞 ζœŸζœ›η»“ζžœ

Selected time are not removed

πŸ’» 倍现代码

import React from "react";
import { EditableProTable } from "@ant-design/pro-components";

export default function App() {
  const [dataSource, setDataSource] = React.useState([]);

  const columns = [
    {
      key: "times",
      dataIndex: "times",
      valueType: "timeRange",
      fieldProps: {
        changeOnBlur: true,
        format: "HH:mm",
        minuteStep: 15,
        order: false,
      },
      formItemProps: {
        rules: [
          {
            required: true,
            message: "Required",
          },
        ],
      },
    },
  ];

  return (
    <>
      {JSON.stringify(dataSource)}
      <EditableProTable
        rowKey="id"
        value={dataSource}
        dataSource={dataSource}
        onChange={setDataSource}
        columns={columns}
        recordCreatorProps={{
          position: "bottom",
          newRecordType: "dataSource",
          record: {
            id: 1,
            times: [],
          },
        }}
      />
    </>
  );
}

Β© η‰ˆζœ¬δΏ‘ζ―

πŸš‘ 兢他俑息

My code was working before. I guess this occurred after an update.