Skip to content

feat: add dropzone support to attachFile#5480

Open
DavertMik wants to merge 1 commit into4.xfrom
feat/dropzone-attach-file
Open

feat: add dropzone support to attachFile#5480
DavertMik wants to merge 1 commit into4.xfrom
feat/dropzone-attach-file

Conversation

@DavertMik
Copy link
Contributor

Summary

  • When attachFile targets a non-file-input element (e.g. a dropzone <div>), it now falls back to dispatching synthetic dragenterdragoverdrop events with a DataTransfer containing the file
  • Adds getMimeType() utility to lib/utils.js for resolving file extensions to MIME types
  • Implemented in all 3 helpers: Playwright, Puppeteer, and WebDriver
  • Existing file input behavior is fully preserved (backward compatible)

Test plan

  • Existing attachFile tests pass for Playwright (2/2)
  • Existing attachFile tests pass for Puppeteer (2/2)
  • New dropzone tests pass for Playwright (2/2)
  • New dropzone tests pass for Puppeteer (2/2)
  • Manual verification with WebDriver

🤖 Generated with Claude Code

When the target element is not an <input type="file">, attachFile now
falls back to dispatching synthetic drag-and-drop events (dragenter,
dragover, drop) with a DataTransfer containing the file. This enables
file uploads to dropzone libraries (Dropzone.js, react-dropzone, etc.).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant