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

把 Shift+Click 多选块(和 Ctrl+Click 单选块)的逻辑从事件 "click" 移动到 "mousedown" #14012

Open
TCOTC opened this issue Feb 3, 2025 · 0 comments

Comments

@TCOTC
Copy link
Contributor

TCOTC commented Feb 3, 2025

  1. 在 "mousedown" 里根据是否会多选块来处理 range(或者添加 protyle-wysiwyg--hidden 类名),解决 鼠标框选块或单元格时不应选中其中的文本 #12120
  2. 其他类 Notion 笔记软件的 Shift+Click 都是在按下鼠标的时候处理的,而思源是在抬起鼠标时处理

附上相关代码用于定位:

if (this.element.querySelector(".protyle-wysiwyg--select") && range.toString() !== "") {
    // 选中块后,文字不能被选中。需在 shift click 之后,防止shift点击单个块出现文字选中
    range.collapse(false);
    focusByRange(range);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant