Skip to content
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

How to distinguish text file or document selection text #1477

Open
why520crazy opened this issue Apr 15, 2016 · 8 comments
Open

How to distinguish text file or document selection text #1477

why520crazy opened this issue Apr 15, 2016 · 8 comments

Comments

@why520crazy
Copy link

I drag document selection text or link,it will show drag-over-show class,if i add ngf-pattern to filter,the text file can't be work .

@danialfarid
Copy link
Owner

elaborate more, create a jsfiddle with steps to reproduce.

@why520crazy
Copy link
Author

http://jsfiddle.net/s8kc7wg0/650/
select text “Upload Log” and drag it to drop area, it will show dragover style.
image

@danialfarid
Copy link
Owner

Remove the ngf-drag-over-class or set the "reject" class to some non-existing class so it would not show the style on invalid drag.

@danialfarid
Copy link
Owner

When you drag over the content of what is being dragged is not completely available that's why it is not possible to detect the text or actual image being dragged. They will only be available after it has been dropped. So you can just have a specific pattern and make the reject class empty so it would not show it if you want only to allow dropping files from file system.

@why520crazy
Copy link
Author

thanks.

http://jsfiddle.net/s8kc7wg0/654/

when set specific pattern ’.*‘, it's ok for drag the content, but drag file from file system can't be work, it should show over class , actually is reject class

@danialfarid
Copy link
Owner

Change it to ngf-pattern="*"

@why520crazy
Copy link
Author

why520crazy commented Apr 20, 2016

if set ngf-pattern="*", drag content “Upload Log” to drop area, it will show dragover style.

i expect that show dragover style only drag from system file.

@danialfarid danialfarid reopened this Apr 24, 2016
why520crazy added a commit to why520crazy/ng-file-upload that referenced this issue Apr 25, 2016
@givehug
Copy link

givehug commented Nov 12, 2018

this works for me
ngf-drag-over-class="{accept:'dragover', pattern:'!text/*'}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants