🎨 Dragging multiple files into the editor will cause them to be opened by the default program (#15773)

This commit is contained in:
Jeffrey Chen 2025-09-05 12:10:44 +08:00 committed by GitHub
parent 647204eee1
commit 17a96ee1b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1418,6 +1418,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
targetElement.classList.remove("dragover__bottom", "dragover__top", "dragover__left", "dragover__right");
}
} else if (!window.siyuan.dragElement && (event.dataTransfer.types[0] === "Files" || event.dataTransfer.types.includes("text/html"))) {
event.preventDefault();
// 外部文件拖入编辑器中或者编辑器内选中文字拖拽
// https://github.com/siyuan-note/siyuan/issues/9544
const avElement = hasClosestByClassName(event.target, "av");