Sworld

Sworld

The only way to do great work is to love what you do.

Solve the issue of Tauri2 not being draggable

Recently, I encountered some issues migrating my game save manager to Tauri2, and it reminded me that I faced this problem before with V1, so I’m documenting it.

The specific issue is that a draggable component on the frontend cannot be dragged. The solution is quite simple: directly modify the src-tauri/tauri.conf.json file and set dragDropEnabled to false. For reference, see below:

{
  "$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
  "productName": "game-save-manager",
  "identifier": "com.game-save-manager",
  "build": {
    "frontendDist": "../dist",
    "devUrl": "http://localhost:3000",
    "beforeDevCommand": "pnpm web:dev",
    "beforeBuildCommand": "pnpm web:generate"
  },
  "app": {
    "windows": [
      {
        "title": "Game Save Manager",
        "width": 1280,
        "height": 720,
        "resizable": true,
        "fullscreen": false,
        "dragDropEnabled": false
      }
    ],
    "security": {
      "csp": null
    }
  },
  "bundle": {
    "active": true,
    "targets": "all",
    "icon": [
      "icons/32x32.png",
      "icons/128x128.png",
      "icons/[email protected]",
      "icons/icon.icns",
      "icons/icon.ico"
    ]
  }
}
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.