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

fix(common): fix the issue of inconsistent element order when pasting #WIK-15106 #822

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

huanhuanwa
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Apr 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plait ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 5:44am
plait-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 5:44am

const newGroup = { ...updateGroupId(item, undefined), id: idCreator() };
elements.push(newGroup);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里以前是直接 push 现在是 splice ,而且感觉这里的 item 是不是可能在数组中找不到啊,是不是会产生混乱,后面的函数里也是类似

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. push 换成 splice 是为了在指定 index 插入,上一版提交的代码忘记处理不在分组中的元素了,刚又提了下
  2. 复制的时候会把所有元素包含分组都放到 clipboardData 中,而 item 是在 clipboardData 中找的,所以一定会找到

@pubuzhixing8 pubuzhixing8 merged commit 9eff29f into develop Apr 15, 2024
3 checks passed
@pubuzhixing8 pubuzhixing8 deleted the w/#WIK-15106 branch April 15, 2024 06:34
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

Successfully merging this pull request may close these issues.

None yet

2 participants