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

Add plugin type TProtyleAction #8988

Closed
3 tasks done
zxhd863943427 opened this issue Aug 16, 2023 · 7 comments
Closed
3 tasks done

Add plugin type TProtyleAction #8988

zxhd863943427 opened this issue Aug 16, 2023 · 7 comments
Assignees
Milestone

Comments

@zxhd863943427
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

在使用protyle创建可编辑区域时使用下面的参数时,会显示预期之外的范围。

let pro = document.createElement("div")
let protyle = new Protyle(this.app,pro,{blockId: "20230816232111-48uimm4",render:{scroll:true}})

显示效果见下,其中 20230816232111-48uimm4 是第一个标题 1 的 id
图片

最小可复现文档见下:
Untitled.sy.zip

Expected result

只显示指定的范围。

Screenshot or screen recording presentation

No response

Version environment

- Version: 2.10.1
- Operating System: win10
- Browser (if used):

Log file

无需日志

More information

No response

@Vanessa219
Copy link
Member

scroll 指的是是否显示右侧的动态滚动条,和滚动位置无关。如果打开过会自动记住上一次的滚动位置。

@zxhd863943427
Copy link
Contributor Author

与滚动条和滚动位置无关,单纯就是启用这个参数后会对显示范围照成影响,但是理论上是不会的,这应该是一个bug。

@Vanessa219
Copy link
Member

设置为 true 的时候,是正常的。只是设置为 false 的时候,该块为动态加载,但是没有动态滚动条,从而导致无法进行动态加载。

@zxhd863943427
Copy link
Contributor Author

所以说,使用protyle时指定显示一个标题,显示了其他标题的内容,是符合预期的吗?

但是它的反应也不均一啊,下面的列表任意删除几项后,也不动态加载了。

这让我不能理解protyle的展示逻辑,使用他来显示标题和标题下内容,有时会显示不在标题下的其他内容,有时又不会。

@Vanessa219
Copy link
Member

块数量达到配置后才会显示动态加载。加载 portyle 时会自动判断是否保存过滚动位置,保存过的话打开会使用上次的位置点。

@zxhd863943427
Copy link
Contributor Author

我认为这可能需要添加判断机制,这导致原本只打算显示标题下内容的部分显示了其他的部分。

@Vanessa219
Copy link
Member

把 action 设置为 ["cb-get-all", "cb-get-focus"] 试试

@Vanessa219 Vanessa219 changed the title protyle 接口在使用scroll参数时表现不符合预期 Plugin API: add TProtyleAction Aug 27, 2023
@Vanessa219 Vanessa219 self-assigned this Aug 27, 2023
@Vanessa219 Vanessa219 added this to the 2.10.2 milestone Aug 27, 2023
@Vanessa219 Vanessa219 changed the title Plugin API: add TProtyleAction Add plugin type TProtyleAction Aug 27, 2023
Vanessa219 added a commit to siyuan-note/petal that referenced this issue Aug 27, 2023
Vanessa219 added a commit to siyuan-note/petal that referenced this issue Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants