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 Report] 对 observable 的数组进行 observe 时,在元素位置调整后,observe 到的 path 不正确 #1598

Closed
1 task done
JustDs opened this issue Jun 17, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@JustDs
Copy link
Contributor

JustDs commented Jun 17, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

创建 observable 的对象数组并 observe,删除数组中的元素,并对删除位置之后元素内的属性进行修改,观察 observe 的结果

What is expected?

observe 到的 path 为元素位置改变后的 path

What is actually happening?

observe 到的 path 为元素位置改变前的 path

Package

@formily/reactive@2.0.0-beta.65


此问题在实际业务场景中,可导致在 ArrayField 中删除中间位置元素并修改原位置属性值的时候,后续所有元素的属性值全部被改变,甚至会在最后多出已被删除的元素

@janryWang
Copy link
Collaborator

来个PR?

@JustDs
Copy link
Contributor Author

JustDs commented Jun 17, 2021

业务需求赶着提测呢实在没空啊,光是排查分析给到这个最小复现就已经花了一天了😫

目前只知道是 index 改变时没有更新 RawNode 里的映射,但是应该在什么时机做这个事我也还没空细看。
这个逻辑毕竟是你写的你应该清楚些,要不至少在这里提供下思路?如果好弄的话我来修也行。

@janryWang
Copy link
Collaborator

大致看了一下,不太好修...

@janryWang janryWang added the bug Something isn't working label Jun 17, 2021
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

No branches or pull requests

2 participants