Skip to content

鼠标框选块或单元格时不应选中其中的文本 #12120

Closed
Listed in
@TCOTC

Description

@TCOTC
Contributor
  • Shift+Click 一闪而过也不美观:Improve multi-select block #14012

20240828151615_rec_-cmDIGKA


  • 像 Notion 那样,多选时只会选中块不会选中文本
    应该能解决多选时每个块的右上角都有一个小竖条的问题 → 好像解决不了 → 我又想到其他方法了:多选块右上角会选中零宽空格 #14614
default.webm

多选单元格的时候文本也会有高亮,会干扰选择单元格:(关联 #11388

default.webm

Activity

changed the title [-]拖动多选块时不应选中文本[/-] [+]🐛 拖动多选块时不应选中文本[/+] on Aug 10, 2024
changed the title [-]🐛 拖动多选块时不应选中文本[/-] [+]拖动多选块时不应选中文本[/+] on Aug 11, 2024
changed the title [-]拖动多选块时不应选中文本[/-] [+]鼠标框选块时不应选中文本[/+] on Aug 28, 2024
TCOTC

TCOTC commented on Nov 3, 2024

@TCOTC
ContributorAuthor

我想到办法了:

  1. 给有被选中的块(或者表格单元格)的编辑器 .protyle-wysiwyg 增加一个类名,比如 .protyle-hidden 之类的

  2. 然后添加 CSS :

    .protyle-hidden ::selection {
        background-color: transparent;
    }
    

之所以不用:

.protyle-wysiwyg--select ::selection, .protyle-wysiwyg--hl ::selection {
    background-color: transparent;
}

是因为会有这种情况:

image


另外用 :has() 选择器的话性能非常差所以也不能纯 CSS 实现

.protyle:has(> .protyle-select:not(.fn__none):not([style*="background-color: transparent;"])) ::selection,
.protyle-wysiwyg--hl ::selection {
    background-color: transparent;
}
changed the title [-]鼠标框选块时不应选中文本[/-] [+]鼠标框选块或单元格时不应选中其中的文本[/+] on Nov 4, 2024
TCOTC

TCOTC commented on Feb 3, 2025

@TCOTC
ContributorAuthor

@Vanessa219 这里的零宽空格有什么用?

Image

TCOTC

TCOTC commented on Feb 11, 2025

@TCOTC
ContributorAuthor

@88250 这个还没解决,重新开一下

9 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@TCOTC

      Issue actions

        鼠标框选块或单元格时不应选中其中的文本 · Issue #12120 · siyuan-note/siyuan