Skip to content

The editor supports using the scroll wheel to scroll the position when dragging #10096

Open
@88250

Description

@88250
Member

Activity

added this to the 2.12.4 milestone on Jan 14, 2024
modified the milestones: 2.12.4, backlog, 2.12.6 on Jan 23, 2024
changed the title [-]The edutir supports using the scroll wheel to scroll the position when dragging[/-] [+]The editor supports using the scroll wheel to scroll the position when dragging[/+] on Jan 26, 2024
removed this from the 2.12.6 milestone on Jan 27, 2024
TCOTC

TCOTC commented on Mar 20, 2024

@TCOTC
Contributor

电脑屏幕没那么大的情况下分屏显示会很不友好,所以当文档长了,还是要有这个功能才方便。

TCOTC

TCOTC commented on May 28, 2024

@TCOTC
Contributor

相关:#10095

TCOTC

TCOTC commented on May 28, 2024

@TCOTC
Contributor

我刚刚发现在大纲拖动的时候是能用滚轮滚动的,只有编辑器和文档树不行。

@88250 要不看一下大纲是怎么能滚动的?

88250

88250 commented on May 28, 2024

@88250
MemberAuthor
TCOTC

TCOTC commented on Dec 22, 2024

@TCOTC
Contributor

我刚刚发现在大纲拖动的时候是能用滚轮滚动的,只有编辑器和文档树不行。

研究了一下有如下发现:

大纲拖拽用的是 addEventListener("mousedown" documentSelf.onmousemove documentSelf.onmouseup,行为有点不同:#13583

编辑器和文档树拖拽用的是 addEventListener("drag... ,能实现跨窗口拖拽块

Myeongho8888

Myeongho8888 commented on Dec 25, 2024

@Myeongho8888

是的,我也发现了同样的问题:

  • 对于篇幅较长的文章,如果可以在拖动用滚轮控制滚动位置,较拖动至边缘自动滚动而言,滚动速度和拖动位置将会更加精确、高效
  • 另外在mac中拖动至边缘自动滚动会经常误触触发dock栏和状态栏,体验很不好
  • 最重要的是:思源笔记中剪切操作会丢失所有的引用关系且现在依然无解,这样就更加高度依赖拖动操作来替代剪切操作,并且这个操作非常非常高频

期待作者大大的更新,感谢!!

TCOTC

TCOTC commented on Feb 4, 2025

@TCOTC
Contributor

我查了一阵子资料,没查到有什么方法实现拖拽的时候通过滚轮滚动。

VSCode 可以在拖拽代码时滚动,但没法跨窗口拖拽。

IDEA 可以跨窗口拖拽(不能跨窗口撤销),但拖拽时滚动不太灵。

Windows 资源管理器也不能在拖拽的时候通过滚轮滚动。

TCOTC

TCOTC commented on Jun 19, 2025

@TCOTC
Contributor

问了 AI,感觉或许有办法

文档树、编辑器、块标:

  1. mousedown 拖拽

    • 使用 mousedown + documentSelf.onmousemove + documentSelf.onmouseup 处理文档树内部拖拽排序
    • 自定义拖拽预览:item.cloneNode(true) 创建预览元素
    • 实时视觉反馈:dragover_top, dragover_bottom, dragover 样式
    • 支持鼠标滚轮滚动
    • 完整的排序逻辑
  2. HTML5 drag API 外部拖拽

    • 保留 dragstart 事件设置 dataTransfer 数据
    • 支持拖拽文件到编辑器等外部组件
    • 保留 dragend 事件
  3. drop 接收外部拖拽

    • 处理块标拖拽等外部内容
    • 处理内部文件拖拽的最终逻辑
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@TCOTC@Myeongho8888

      Issue actions

        The editor supports using the scroll wheel to scroll the position when dragging · Issue #10096 · siyuan-note/siyuan