Closed RensBloom closed 4 years ago
+1
+1
+1
+1
+1
+1
-webkit-user-drag
-khtml-user-drag
(for older webkit browsers)I don't have any info on hand as to which browsers or versions support those css properties. On caniuse, searching for the properties gives no results.
Permitted values:
auto
- default browser behaviourelement
- entire element should be dragged, not just contentsinherit
- inherit from parent elementnone
- dragging is not permitted for both element and contentsSome additional infos:
Supported on these elements: a, abbr, acronym, address, b, bdo, big, blockquote, body, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, ins, isIndex, kbd, label, legend, li, marquee, menu, ol, p, pre, q, s, samp, small, span, strike, strong, sub, sup, table, td, textarea, th, tr, tt, u, ul, var, xmp
I assume it's supported on all elements.
Safari 3.0+
I assume earlier due to aforementioned -khtml-user-drag
property.
Part of the drag and drop API, the modern approach is the draggable
attribute on elements:
<div draggable="true">whole div will be dragged</div>
<div draggable="false">you cannot drag this div or its text</div>
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
Searching caniuse leads to a feature page: https://caniuse.com/#feat=dragndrop
It would be good if the component parts of the feature could get their own pages to promote collection of browser compatibility especially on mobile devices.
+1 to this as well.
Draggable attribute available at https://caniuse.com/#feat=mdn-html_global_attributes_draggable
-webkit-user-drag
now available at https://caniuse.com/webkit-user-drag
Hey, I'm new to github (literally signed up to post this) so apologies if commenting here like this is incorrect etiquette... I just thought you should be aware that I found the following info at stackoverflow, thought it might be of use:
-webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none; -o-user-drag: none; user-drag: none;
@broseph-juce Thanks, I also ran into that in my research, however I couldn't find any evidence of browsers actually supporting the -moz-
, -o-
or the unprefixed version, so I think those were only ever included in the hopes that other browsers might adopt them (or just habit when writing prefixed properties). The -khtml-
prefix is something of a legacy prefix that maps to -webkit-
.
There is an option to disable dragging of elements in HTML5 (
draggable="false"
) as well as in CSS (-webkit-user-drag: none;
). It would be great if these two could be added.