瀏覽代碼

chore: add comment explaining preventDefault() usage

Lucas Nogueira 3 年之前
父節點
當前提交
0c45641398
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      core/tauri/scripts/core.js

+ 1 - 0
core/tauri/scripts/core.js

@@ -134,6 +134,7 @@
   // drag region
   document.addEventListener('mousedown', (e) => {
     if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) {
+      // prevents text cursor
       e.preventDefault()
       // start dragging if the element has a `tauri-drag-region` data attribute and maximize on double-clicking it
       window.__TAURI_INVOKE__('tauri', {