baidu / baidu/amis

富文本组件tinymce相关报错,TypeError: Cannot read properties of undefined (reading 'select')

Open
#8,024 2 comments 0 reactions 0 assignees View on GitHub
help wanted need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

富文本组件有图片的情况下报错,有时报错,有时不报错,出现频率较高

#### 截图或视频:

![image](https://github.com/baidu/amis/assets/12456315/b46a858d-0daa-40e5-b7a6-a53b337442c2)

#### 如何复现(请务必完整填写下面内容):

1. 你是如何使用 amis 的?
vue项目中使用,参考vue2-amis-demo这个项目做的

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在3.
3.4.0-beta.12

4. 粘贴有问题的完整 `amis schema` 代码:
```
{
"type": "input-rich-text",
"label": "富文本",
"name": "background",
"id": "u:6d7a2fb5dfa6",
"vendor": "tinymce",
"options": {
"plugins": "advlist,autolink,link,image,lists,charmap,preview,anchor,pagebreak,searchreplace,wordcount,visualblocks,visualchars,code,fullscreen,insertdatetime,media,nonbreaking,table,emoticons,template,help",
"toolbar": "undo redo formatselect bold italic backcolor alignleft aligncenter alignright alignjustify bullist numlist outdent indent removeformat help",
"menubar": true
},
"receiver": {
"url": "${window:location.origin}/xxxxx",
"method": "post",
"requestAdaptor": "",
"adaptor": "",
"messages": {
}
}
}
```

5. 操作步骤
富文本坐在的form表单是在drawer抽屉里,富文本中有图片,点击列表中的不同的行,打开抽屉,有时会出现上面截图中的报错

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue in the Vue setup using the provided input-rich-text schema, especially when switching rows and reopening the drawer with images present. Trace the rich-text component and TinyMCE lifecycle around drawer changes; done means the select error no longer appears in repeated image-containing cases.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.