Skip to content

ngf-accept and drag and drop #855

Closed
Closed
@chriswong929

Description

@chriswong929

When I have a div with both drag-and-drop and file select functionality, and I am also using ngf-accept, ngf-accept does not work properly.

For example, in the code demo (http://jsfiddle.net/18yao91v/), we have accept="image/*,application/pdf"
However, we are still able to drag and drop unaccepted file types into the div. Even though the file select modal restricts unaccepted file types, the drag and drop portion does not.

If, however, we are using ngf-accept="'image/*,application/pdf'"
Then the file select modal no longer restricts unaccepted file types anymore (we can file select a zip file). Specifically, it no longer denies the option to select an incorrect file type but if we try to upload a file of the wrong type, it actually does not complete the upload.

However, using ngf-accept instead of just accept will force drag and drop to no longer accept incorrect file types.

This can be reproduced by going to http://jsfiddle.net/18yao91v/ and changing the line accept="image/*,application/pdf" to ngf-accept="'image/*,application/pdf'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions