Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
erdemkeren opened this issue Mar 6, 2024 · 0 comments

Comments

@erdemkeren
Copy link

πŸ› bug 描述

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

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

  • Open this codesandbox.
  • Click on Add button
  • Select times and click ok.
  • The times are removed one after another.

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

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: [],
          },
        }}
      />
    </>
  );
}

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

  • ProComponents η‰ˆζœ¬: [e.g. 2.6.49]
  • ζ΅θ§ˆε™¨ηŽ―ε’ƒ: Firefox, Chrome, Arc
  • εΌ€ε‘ηŽ―ε’ƒ mac OS

πŸš‘ 兢他俑息

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant