-
Notifications
You must be signed in to change notification settings - Fork 211
Drag & Drop Improvements #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, couple nits
src/hooks/use-file-upload.tsx
Outdated
const handleDrop = async (e: DragEvent) => { | ||
const handleWindowDragLeave = (e: DragEvent) => { | ||
if (e.dataTransfer?.types?.includes("Files")) { | ||
dragCounter.current--; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, a little clearer
dragCounter.current--; | |
dragCounter.current -= 1; |
src/hooks/use-file-upload.tsx
Outdated
// Global drag events with counter for robust dragOver state | ||
const handleWindowDragEnter = (e: DragEvent) => { | ||
if (e.dataTransfer?.types?.includes("Files")) { | ||
dragCounter.current++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
dragCounter.current++; | |
dragCounter.current += 1; |
src/hooks/use-file-upload.tsx
Outdated
const items = e.clipboardData.items; | ||
if (!items) return; | ||
const files: File[] = []; | ||
for (let i = 0; i < items.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to turn on the eslint rule for this
for (let i = 0; i < items.length; i++) { | |
for (let i = 0; i < items.length; i += 1) { |
isBase64ContentBlock()
tomultimodal-utils.ts