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] ListTable 设置 keyboardOptions pasteValueToCell 后粘贴多列时 change_cell_value 事件回调 row col 都是一样的 #919

Closed
xiaoosnggao opened this issue Jan 15, 2024 · 4 comments · Fixed by #923
Assignees
Labels
bug Something isn't working

Comments

@xiaoosnggao
Copy link
Contributor

Version

0.17.9

Link to Minimal Reproduction

https://visactor.io/vtable/demo/interaction/copy-paste-cell-value

Steps to Reproduce

image

当我复制了 Customer ID Product Name Category 三列以后进行粘贴

将下方代码粘贴到复制代码的示例里即可

let  tableInstance;
  fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_data.json')
    .then((res) => res.json())
    .then((data) => {

  const columns =[
      {
          "field": "Order ID",
          "title": "Order ID",
          "width": "auto"
      },
      {
          "field": "Customer ID",
          "title": "Customer ID",
          "width": "auto"
      },
      {
          "field": "Product Name",
          "title": "Product Name",
          "width": "auto"
      },
      {
          "field": "Category",
          "title": "Category",
          "width": "auto"
      },
      {
          "field": "Sub-Category",
          "title": "Sub-Category",
          "width": "auto"
      },
      {
          "field": "Region",
          "title": "Region",
          "width": "auto"
      },
      {
          "field": "City",
          "title": "City",
          "width": "auto"
      },
      {
          "field": "Order Date",
          "title": "Order Date",
          "width": "auto"
      },
      {
          "field": "Quantity",
          "title": "Quantity",
          "width": "auto"
      },
      {
          "field": "Sales",
          "title": "Sales",
          "width": "auto"
      },
      {
          "field": "Profit",
          "title": "Profit",
          "width": "auto"
      }
  ];

  const option = {
    records:data,
    columns,
    widthMode:'standard',
    frozenColCount:1,
    overscrollBehavior:'none',
    keyboardOptions:{
      moveEditCellOnArrowKeys:true,
      copySelected: true,
      pasteValueToCell: true
    }
  };

const handleTableCellChange = (value,n) => {
      console.log('gxs --> % handleTableCellChange % value:\n', value,n)
    }

  tableInstance =  new VTable.ListTable(document.getElementById(CONTAINER_ID),option);

  tableInstance.on('change_cell_value', handleTableCellChange)

  window['tableInstance'] = tableInstance;
      })

Current Behavior

目前触发change_cell_value三次,并且三次回调的 col row 参数都是一样的

Expected Behavior

应该触发三次change_cell_value回调,并且返回正确的 col row

Environment

- OS: Windows
- Browser: chrome
- Framework:react 18

Any additional comments?

No response

@xiaoosnggao xiaoosnggao added the bug Something isn't working label Jan 15, 2024
@fangsmile
Copy link
Contributor

收到问题 我们处理下

@fangsmile fangsmile self-assigned this Jan 15, 2024
@fangsmile fangsmile linked a pull request Jan 15, 2024 that will close this issue
21 tasks
@xiaoosnggao
Copy link
Contributor Author

@fangsmile 哈喽,这个bug预计什么时候能发出来呢,这两天复制粘贴手都麻了

@fangsmile
Copy link
Contributor

ok 今天发给你哈

@xiaoosnggao
Copy link
Contributor Author

ok 今天发给你哈
谢谢~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants