wangEditor icon indicating copy to clipboard operation
wangEditor copied to clipboard

wangEditor5.1.23版本,使用自定义上传多次上传报错

Open longsiping opened this issue 1 year ago • 1 comments

bug 描述

使用wangEditor5.1.23版本,customUpload自定义上传功能,调用insertFn方法插入富文本内时,只上传一张图片没啥问题,上传完成后,再继续上传一张,就提示子节点无法找到;[Unhandled Rejection (Error): Cannot find a descendant at path [0,4] in node: {"children"](global.js:1 Uncaught (in promise) Error: Cannot find a descendant at path [1] in node: {"children":[{"type":"paragraph","children":[{"text":"1231"}]}],"operations":[],"selection":{"anchor":{"path":[1,0],"offset":0},"focus":{"path":[1,0],"offset":0}},"marks":null,"id":"wangEditor-10","isDestroyed":false,"isFullScreen":false,"history":{"undos":[[{"type":"split_node","path":[0,0],"position":4,"properties":{}},{"type":"split_node","path":[0],"position":1,"properties":{"type":"paragraph"}}],[{"type":"remove_text","path":[0,0],"offset":0,"text":"1231"},{"type":"remove_node","path":[0],"node":{"type":"paragraph","children":[{"text":""}]}},{"type":"remove_node","path":[0],"node":{"type":"paragraph","children":[{"text":""}]}},{"type":"insert_node","path":[0],"node":{"type":"paragraph","children":[{"text":"1231"}]}},{"type":"set_selection","properties":{"anchor":{"path":[0,0],"offset":4},"focus":{"path":[0,0],"offset":4}},"newProperties":{"anchor":{"path":[1,0],"offset":0},"focus":{"path":[1,0],"offset":0}}}]],"redos":[]}})

代码


## 你预期的样子是?

*请输入内容……*

## 系统和浏览器及版本号

- 操作系统
- 浏览器和版本

## wangEditor 版本
5.1.23
*请输入内容……*

## demo 能否复现该 bug ?
能
能/不能

- 中文 demo https://www.wangeditor.com/demo/
- English demo https://www.wangeditor.com/demo/?lang=en

## 在线 demo

*请尽量提供在线 demo (推荐以下网站),帮助我们最低成本复现 bug*

- https://codesandbox.io/
- https://codepen.io/
- https://stackblitz.com/

## 最小成本的复现步骤

(请告诉我们,如何最快的复现该 bug)

- 步骤一
- 步骤二
- 步骤三

longsiping avatar Sep 23 '24 09:09 longsiping