Skip to content

Add drag & drop upload to QR Code → Text#6

Open
Copilot wants to merge 1 commit intomainfrom
copilot/support-drag-and-drop-upload
Open

Add drag & drop upload to QR Code → Text#6
Copilot wants to merge 1 commit intomainfrom
copilot/support-drag-and-drop-upload

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

The QR Code → Text decoder only supported click-to-upload via a plain button. This adds a proper drag-and-drop zone as the primary upload interaction.

Changes

  • Drop zone UI — Replaces the upload button with a styled dashed-border zone; supports both drag-and-drop and click-to-open-picker
  • Drag-over highlightisDragOver state toggles border-primary/bg-primary/5 on enter/leave
  • onDragLeave flicker fix — Guards against spurious leave events when cursor moves over child elements:
    onDragLeave={(e) => {
      if (!e.currentTarget.contains(e.relatedTarget as Node)) {
        setIsDragOver(false)
      }
    }}
  • Shared decodeFile callback — Extracts image-reading/jsQR logic into a useCallback consumed by both the drop handler and the file <input> onChange

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.

2 participants