wails/v3/test/dnd-npm-runtime/frontend
Lea Anthony c0d2c1e237
fix(runtime): file drop not working with @wailsio/runtime npm module (#4953)
* fix(runtime): use internal path for HandlePlatformFileDrop

The Go backend was calling window.wails.Window.HandlePlatformFileDrop()
for native file drops on macOS/Linux. This only worked with the bundled
runtime which sets window.wails = Runtime.

When using the @wailsio/runtime npm module, window.wails is an empty
object because the npm module only exports via ES modules and registers
the handler at window._wails.handlePlatformFileDrop.

Changed the Go code to call the internal path that both runtime
distributions set up: window._wails.handlePlatformFileDrop()

Also added a test case that uses the npm module to verify the fix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add changelog entry for npm runtime DND fix

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: add built frontend dist for dnd-npm-runtime test

Required for go:embed to work in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: update README to reflect pre-built frontend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 07:25:09 +11:00
..
dist fix(runtime): file drop not working with @wailsio/runtime npm module (#4953) 2026-02-04 07:25:09 +11:00
index.html fix(runtime): file drop not working with @wailsio/runtime npm module (#4953) 2026-02-04 07:25:09 +11:00
main.js fix(runtime): file drop not working with @wailsio/runtime npm module (#4953) 2026-02-04 07:25:09 +11:00
package.json fix(runtime): file drop not working with @wailsio/runtime npm module (#4953) 2026-02-04 07:25:09 +11:00
vite.config.js fix(runtime): file drop not working with @wailsio/runtime npm module (#4953) 2026-02-04 07:25:09 +11:00