alibaba / alibaba/lowcode-engine
array setter 排序仍然有问题
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
## **Describe the bug (required)** / **详细描述 bug(必填)**
在排序过程中会自动添加值
---
## **To Reproduce (required)** / **如何复现 bug?(必填,非常重要)**
中文版示例:
1. 打开 [demo](https://lowcode-engine.cn/demo/demo-general/index.html);
2. 清空所有
3. 从组件库中选择 *步骤表单*(搜索 `step`)拖入画布, 可以看到右侧的步骤项有两项,并且没有图标
4. 为这两个步骤项选择图标(切记不要先添加)
5. 添加一项,也是没有图标的
6. 将新添加的一项拖到其他位置,此刻发现图标已将添加值了
7.
## **Expected behavior (required)** / **预期行为(必填,非常重要)**
不应该自动添加值
## **Environments (please complete the following information) (required):** / **请提供如下信息(必填)**
- AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本: v1.1.8-beta
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本: v1.0.6-beta.28
- Browser [e.g. chrome, safari] / 浏览器版本: Chrome 114.0.5735.134(正式版本) (64 位)
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本
> (this information can be collected via [the manual plugin](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png) / 版本信息可[通过低代码用户手册插件收集](https://img.alicdn.com/imgextra/i1/O1CN0115zonY1IsgbkZ2ir7_!!6000000000949-2-tps-3066-1650.png))
## **Additional context (optional)** / **更多额外信息(可选)**
做了一些测试, 发现 icon 没有初始值会存在这个问题
疑问: 排序的过程中 getDerivedStateFromProps 会执行两次, 第一次返回的 items 是排序前的结果,为啥第二次进入时 state 就变成新的值了(看到之前把排序处的 setState 去掉了)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.