Skip to content

[BUG] Inconsistency: cases when isDragReject is true but onDrop later sees as accepted files #1244

Description

@haywirez

When dropping in files conforming to {accept: { 'model/gltf-binary': ['.glb'] }}, I noticed that file.type ends up being an empty string but still set as accepted inside onDrop due to the file extension check. However isDragReject still reports true during the drag. Upon deeper investigation this seems to be due to the fact that the file type list is not available inside the event's dataTransfer during dragenter/dragover yet.

I'm not sure about the root cause, it seems like it happens when dragging in certain less common file MIME types, either the OS or Chrome doesn't report them... (tested on MacOS 12.5.1 / Chrome ). It also happens when dragging in folders (#977), and is mentioned in several issues (for example, #25, #276).

I would like to suggest (and offer) to implement isDragUnknown to offer better end-user feedback, in situations where the drag is ambious. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions