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

使用 iframe 块嵌入挂件时部分操作会触发选中块并导致运行时异常 #4172

Closed
Zuoqiu-Yingyi opened this issue Mar 6, 2022 · 5 comments
Assignees
Labels
Milestone

Comments

@Zuoqiu-Yingyi
Copy link
Contributor

描述问题 Describe the problem

使用 iframe 嵌入挂件时(复现过程中资源设置为 widgets/url-scheme)

  1. 若鼠标多次单击 iframe 内非空的 input 元素时会选中该 iframe 块
  2. 在 iframe 内空的 input 元素中使用中文输入法(QQ拼音输入法)单击一个字母后使用数字键选字, 会选中该 iframe 块
  3. 在 iframe 内空的 input 元素中使用中文输入法(QQ拼音输入法)单击一个字母后再单击一个字母, 会删除当前 iframe 块与上方部分相邻段落, 之后的撤销操作会出现运行时异常(该文档打开后未进行任何编辑操作时可复现), 日志详见 问题 3 日志
  4. 若 3 中 iframe 块的上方没有其他块, 不会出现删除, 但 iframe 块样式出现问题, 同时块菜单失效, 日志详见 问题 4 日志

期待的结果 Expected result

焦点位于 iframe 中时, 任何事件都被 iframe 捕获, 并不会向上传递

截屏或者录屏演示 Screenshot or screen recording presentation

  1. 思源笔记-bug反馈-10
  2. 思源笔记-bug反馈-11
  3. 思源笔记-bug反馈-12
  4. 思源笔记-bug反馈-13

版本环境 Version environment

  • Version:
  • Operating system:
  • Browser (if used):

日志文件 Log File

问题 3 日志

内核日志
I 2022/03/06 14:08:11 database.go:72: reinitialized database [D:\Notebook\Siyuan\workspace\temp\siyuan.db]
I 2022/03/06 14:08:11 index.go:204: rebuilt database for notebook [20210808180117-czj9bvb] in [0.25s], tree stat [count=49, size=1.0 MB]
I 2022/03/06 14:08:11 index.go:204: rebuilt database for notebook [20211117210244-rd7a3f9] in [0.05s], tree stat [count=5, size=378 kB]
I 2022/03/06 14:08:13 index.go:204: rebuilt database for notebook [20210917000226-w9fa32i] in [1.22s], tree stat [count=85, size=1.1 MB]
I 2022/03/06 14:08:13 index.go:204: rebuilt database for notebook [20210916152511-9ihqyfi] in [0.54s], tree stat [count=122, size=3.2 MB]
I 2022/03/06 14:08:17 index.go:204: rebuilt database for notebook [20210918102434-mtrd8yr] in [2.52s], tree stat [count=884, size=11 MB]
I 2022/03/06 14:08:18 index.go:204: rebuilt database for notebook [20211202140059-zm0xt6u] in [0.05s], tree stat [count=9, size=8.4 kB]
I 2022/03/06 14:08:18 index.go:204: rebuilt database for notebook [20211203004753-8okas3v] in [0.04s], tree stat [count=5, size=23 kB]
I 2022/03/06 14:08:18 index.go:204: rebuilt database for notebook [20211204012232-tfejc3a] in [0.14s], tree stat [count=46, size=403 kB]
I 2022/03/06 14:08:18 index.go:204: rebuilt database for notebook [20210914201520-i0v92g9] in [0.26s], tree stat [count=95, size=1.8 MB]
I 2022/03/06 14:08:18 index.go:214: resolving refs...
I 2022/03/06 14:08:19 index.go:354: resolved refs [3055]
E 2022/03/06 14:12:54 transaction.go:947: update data is nil
Web 控制台日志
main.f73cf3084fa173296595.js:1 addRange(): The given range isn't in document.
t.focusByRange @ main.f73cf3084fa173296595.js:1
t.focusBlock @ main.f73cf3084fa173296595.js:1
t.onTransaction @ main.f73cf3084fa173296595.js:1
(anonymous) @ main.f73cf3084fa173296595.js:1
render @ main.f73cf3084fa173296595.js:1
undo @ main.f73cf3084fa173296595.js:1
(anonymous) @ main.f73cf3084fa173296595.js:1

问题 4 日志

Web 控制台日志
main.f73cf3084fa173296595.js:1 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'outerHTML')
    at main.f73cf3084fa173296595.js:1
    at Generator.next (<anonymous>)
    at main.f73cf3084fa173296595.js:1
    at new Promise (<anonymous>)
    at i (main.f73cf3084fa173296595.js:1)
    at t.input (main.f73cf3084fa173296595.js:1)
    at HTMLDivElement.<anonymous> (main.f73cf3084fa173296595.js:1)
(anonymous) @ main.f73cf3084fa173296595.js:1
(anonymous) @ main.f73cf3084fa173296595.js:1
i @ main.f73cf3084fa173296595.js:1
t.input @ main.f73cf3084fa173296595.js:1
(anonymous) @ main.f73cf3084fa173296595.js:1
@88250 88250 self-assigned this Mar 6, 2022
@88250 88250 added this to the backlog milestone Mar 9, 2022
@88250 88250 assigned Vanessa219 and unassigned 88250 Mar 9, 2022
@88250 88250 modified the milestones: backlog, 1.9.0 Mar 9, 2022
@Vanessa219 Vanessa219 added the Bug label Mar 10, 2022
@Zuoqiu-Yingyi
Copy link
Contributor Author

Zuoqiu-Yingyi commented Mar 17, 2022

@Vanessa219v1.9.1 中 bug 1, 3 又出现了, 而且同时出现在挂件块与 iframe 块中

  • 1 中 bug 复现步骤不变, 多次单击非空的 input 元素时会选中该块, 之后单击 backspace 会删除该块
  • 3 中 bug 复现步骤不变, 不过结果改为直接在 DOM 中删除 <iframe> 节点及其上级节点并在块内插入两个 <br>

@Vanessa219
Copy link
Member

我这里重现不了

QQ20220317-205336-HD.mp4

@Zuoqiu-Yingyi
Copy link
Contributor Author

我这里重现不了

思源笔记-bug反馈-18

输入框内有内容时双击输入框后单击 backspace 键试试, bug 3 可能也是因为该原因

@Vanessa219
Copy link
Member

又修改了下,就不新建 issue 了。还麻烦下个版本再看看。

@Zuoqiu-Yingyi
Copy link
Contributor Author

又修改了下,就不新建 issue 了。还麻烦下个版本再看看。

目前看没有问题了🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants