alibaba / formily

📱🚀 🧩 Cross Device & High Performance Normal Form/Dynamic(JSON Schema) Form/Form Builder -- Support React/React Native/Vue 2/Vue 3
https://formilyjs.org/
MIT License
11.32k stars 1.48k forks source link

[Bug Report] antd-v5 ArrayTable 条目拖曳至表格外后索引为NaN #3971

Closed tmsi10 closed 1 year ago

tmsi10 commented 1 year ago

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. 使用文档的Markup Schema 案例
  2. 新增条目
  3. 提交表格
  4. 校验器提示a2 a3为必填
  5. 把条目拖曳至表格外才松开
  6. 校验器提示消失
  7. 填写a2 a3
  8. 再次提交表格

What is expected?

  1. 拖曳后保留校验器提示
  2. 填写后能够成功提交表格

What is actually happening?

从console看见校验错误且条目索引为NaN

Package

@formily/antd-v5@1.1.1


  1. Dnd kit 里 onDragEndDragEndEvent.over 在拖曳至容器外时为null
  2. SortableContainerover?.id 减1 变成 NaN
  3. ArrayTable 里的组件在 onDragEnd 调用 ArrayField.move(oldIndex, newIndex /* NaN */);
yiyunwan commented 1 year ago

已修复 https://github.com/formilyjs/antd/pull/26