Skip to content

refactor: extract shared dropFile script for attachFile dropzone support#5486

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

refactor: extract shared dropFile script for attachFile dropzone support#5486
DavertMik wants to merge 1 commit into4.xfrom
feat/dropzone-attach-file

Conversation

@DavertMik
Copy link
Contributor

Summary

  • Extracts the inline drop-event script duplicated across Playwright, Puppeteer, and WebDriver into lib/helper/scripts/dropFile.js
  • All three helpers now import and use the shared dropFile function instead of copy-pasting the browser-side code
  • Addresses review feedback from feat: add dropzone support to attachFile #5480 about code duplication

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)

🤖 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>
@DavertMik DavertMik force-pushed the feat/dropzone-attach-file branch from 550015a to a75abfd Compare March 9, 2026 23:14
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