Skip to content

fix: prevent non-file drags from showing upload overlay#1604

Open
anirudhu-ui wants to merge 1 commit into
magic-peach:mainfrom
anirudhu-ui:aniru/fix-brightness-drag-overlay
Open

fix: prevent non-file drags from showing upload overlay#1604
anirudhu-ui wants to merge 1 commit into
magic-peach:mainfrom
anirudhu-ui:aniru/fix-brightness-drag-overlay

Conversation

@anirudhu-ui

Copy link
Copy Markdown

Summary

Fixes the page-level upload overlay so it only responds to real file drags. This prevents normal in-app drag interactions, like dragging the Brightness slider, from being treated as a video upload attempt.

Root cause

The document-level drag handlers in FileUpload.tsx were calling preventDefault() and showing the overlay for every drag event. That meant non-file drag events from UI controls could activate the global "Drop your video anywhere" overlay.

Changes

  • Added a small isFileDrag guard based on dataTransfer.types.
  • Applied the guard to the global dragenter, dragleave, dragover, and drop handlers.
  • Kept external file drag-and-drop behavior intact.
  • Added regression coverage for file and non-file document drag events.

Verification

  • npm test -- --run src/components/__tests__/FileUpload.test.tsx
  • npm test -- --run
  • npm run lint
  • npm run build

Fixes #1515

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@anirudhu-ui is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Format Check Passed — @anirudhu-ui

Basic format checks passed. A maintainer will review your code changes.

This does not mean the PR is approved — it just means the format is correct.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @anirudhu-ui!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions github-actions Bot added level:intermediate Intermediate level - 35 pts type:bug Bug fix type:design UI/UX design type:testing Testing labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:intermediate Intermediate level - 35 pts type:bug Bug fix type:design UI/UX design type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX Bug] Dragging Brightness slider triggers global drag-and-drop overlay instead of adjusting value

1 participant