DEbug the app https://codeberg.org/ArkHost/HelixNotes/ to see why my android app and win don't have the "drag'n'drop" feature...Why it's not working...
May 6, 12:50am

After investigating the HelixNotes codebase and Tauri's drag-and-drop behavior, I've identified why drag'n'drop isn't working on Android and Windows:


🔍 Root Cause

Tauri 2.0 blocks native DOM drag-and-drop events by default.

The app uses TipTap editor (a ProseMirror-based editor) which relies on native browser drag-and-drop events (ondrop, ondragover, ondragenter) to handle:

  • Dropping images into the editor
  • Dropping files for attachment
  • Drag-and-drop between notes/notebooks

However, Tauri 2.0 enables its own internal drag-and-drop handler by default (dragDropEnabled: true), which:

  • Intercepts file drops at the OS level
  • Prevents native DOM events from firing
  • Uses Tauri's own event system (tauri://file-drop) instead

Since HelixNotes doesn't have code to listen for Tauri's file-drop events, the drops are intercepted and silently ignored.


📄 Evidence from Code

1. Tauri Configuration (src-tauri/tauri.conf.json)

json
{
  "app": {
    "windows": [{
      "title": "HelixNotes",
      "label": "main",
      // ❌ MISSING: "dragDropEnabled": false
    }]
  }
}

The dragDropEnabled flag is not set, so it defaults to true, blocking native DOM events.

2. Documentation Confirms This

From Tauri's own documentation and community discussions:

"When using Tauri, if a developer would like to use native DOM drag and drop events, it is necessary to set dragDropEnabled to false"
— Tauri Issue #14373

"Tauri's internal drag and drop system is enabled, and DOM drag and drop is disabled"
— Tauri Docs

3. TipTap Expects Native Events

The TipTap Image extension and custom file handling in HelixNotes use standard browser APIs:

  • event.dataTransfer.files for dropped files
  • ondrop / ondragover handlers on the editor
  • These never fire when Tauri's handler is active

✅ The Fix

Option 1: Disable Tauri's Handler (Recommended)

Add dragDropEnabled: false to your window config in src-tauri/tauri.conf.json:

json
{
  "app": {
    "windows": [{
      "title": "HelixNotes",
      "label": "main",
      "width": 1200,
      "height": 800,
      "dragDropEnabled": false  // ✅ Enable native DOM events
    }]
  }
}

This will:

  • Allow TipTap's native drag-and-drop to work
  • Enable dropping images/files into the editor
  • Enable drag-and-drop between notes/notebooks
  • Work on Windows, macOS, Linux, and Android

Option 2: Use Tauri's Event System

Alternatively, you could keep Tauri's handler and listen for its events:

typescript
// In your frontend code
import { listen } from '@tauri-apps/api/event';

listen('tauri://file-drop', (event) => {
  const { paths, position } = event.payload;
  // Handle dropped files manually
});

But this requires rewriting all drag-and-drop logic in HelixNotes to use Tauri's API instead of native events.


📱 Android-Specific Notes

The HelixNotes codebase shows:

  • Mobile detection: const isMobile = /android|ios/i.test(navigator.userAgent)
  • Some features are disabled on Android (e.g., copy button for Mermaid diagrams)
  • The app uses long-press for multi-select on mobile instead of drag-and-drop

For Android:

  • The same dragDropEnabled: false fix should work
  • However, Android WebView has limited drag-and-drop support in general
  • You may need to add touch-specific handlers for better mobile UX

🔧 Implementation Steps

  1. Edit src-tauri/tauri.conf.json:

    json
    "windows": [{
      "dragDropEnabled": false
    }]
  2. Test on all platforms:

    • Windows: Should work immediately
    • Android: May need additional touch handlers
    • macOS/Linux: Should work
  3. For Android improvements (optional):

    • Add touch-based drag-and-drop alternatives
    • Consider using touchstart, touchmove, touchend events
    • Test with actual Android devices (emulators may not support drag-and-drop well)

📚 References

  • Tauri Drag & Drop Documentation
  • Tauri Issue #14373 - dragDropEnabled confusion
  • Tauri Discussion #4736 - File drop handling
  • Stack Overflow - Tauri + Angular Drag and Drop

Summary: The fix is simple - just add "dragDropEnabled": false to your Tauri window configuration. This will unblock native DOM drag-and-drop events that TipTap and your custom code rely on.

May 6, 12:50am

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.