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

disable user dragging on images #996

Closed
csicar opened this issue Feb 26, 2012 · 6 comments
Closed

disable user dragging on images #996

csicar opened this issue Feb 26, 2012 · 6 comments

Comments

@csicar
Copy link

csicar commented Feb 26, 2012

For disabling user dragging on images
Just add

user-drag: none;
-moz-user-select: none;
-webkit-user-drag: none;

to the standart css.
I think that helps webpages react like they should

@eligundry
Copy link

I dunno how I feel about this. Doesn't this break some of the cool things that you can do with HTML5 (i.e. drag and drop images into a Gmail message from one window to another)?

@dpogue
Copy link

dpogue commented Feb 26, 2012

No, this prevents img tags themselves from being draggable. You can see an example of the problem by clicking and dragging the github logo at the top of the page.
Usually you don't want pieces of your site layout to be draggable.

@mathiasbynens
Copy link
Member

Why would you want to prevent people from saving the images to their HD by dragging it from the webpage onto their desktop? There are use cases for it, but I don’t think we should do this by default.

@necolas
Copy link
Member

necolas commented Feb 26, 2012

Draggable images are a common user expectation. I use them all the time to save images to my desktop or open them in Photoshop. So, we're going to pass on this one. But thanks for the suggestion.

@necolas necolas closed this as completed Feb 26, 2012
@chadams
Copy link

chadams commented Nov 2, 2015

here is a real world scenario. We are making a kiosk with no desktop, user is using touch and gestures for interaction. if they touch an image and drag we get a ghost image for dragging onto desktop which totally breaks the gesture interactions. On chrome -webkit-user-drag: none; totally fixes this issue, Mozilla is still broken as -moz-user-select: none; & user-drag: none; have no effect.

@patrickkettner
Copy link
Contributor

That is a great reason to disable drag n drop on your site, not every site using h5bp

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

No branches or pull requests

7 participants