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

建议不要以当前块为焦点,而使用鼠标光标所在行作为焦点中心 #14

Open
shawnyuan-cn opened this issue May 29, 2024 · 1 comment
Labels
question Further information is requested

Comments

@shawnyuan-cn
Copy link

在一个新的文本块输入内容时,焦点不会随文本输入的行数增多而改变进而自动滚动。

大概在接近屏幕1/3的时候就会开始影响体验,当文本超过1/2时光标已经在屏幕外了。

顺便一提,表格内会成功按照鼠标光标所在行作为焦点,大概是逻辑不同吧。

@Zuoqiu-Yingyi
Copy link
Owner

在一个新的文本块输入内容时,焦点不会随文本输入的行数增多而改变进而自动滚动。

目前表格块与代码块的滚动粒度可以设置为行, 其他块的滚动粒度都是块, 主要有如下两个原因

  1. 目前滚动使用 API Element: scrollIntoView() 实现, 该 API 仅支持滚动某个具体的 HTML 元素, 而段落块若忽略内部的行内元素的话, 整个块就是最小的 HTML 元素, 因此不太好实现以行粒度滚动
  2. 我个人认为在输入时如果滚动频率过高会干扰到输入时的注意力

表格内会成功按照鼠标光标所在行作为焦点

表格块与代码块因为在块内部有更小的元素 (表格中有单元格, 代码每行都有换行符分隔), 因此才能实现更细粒度的滚动

@Zuoqiu-Yingyi Zuoqiu-Yingyi added the question Further information is requested label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants