Bug 178058
Summary: | dataTransfer.effectAllowed returns "all" when it's set to "copy" or "move" during dragstart | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, darin, govett, vissu_nbkr, webkit-bug-importer, wenson_hsieh |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | https://jsfiddle.net/4tfzmLwo/ |
Ryosuke Niwa
When dataTransfer.effectAllowed to set to "copy", "move", etc... during dragstart,
a subsequent drag event's dataTransfer's effectAllowed always returns "all"
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/34874174>
Wenson Hsieh
Small test case showing the problem:
<div id="source" draggable="true">Drag me!</div>
<script>
function write(text) {
let element = document.createElement("pre");
element.textContent = text;
document.body.appendChild(element);
}
function writeEffectAllowed(event) {
write(`(${event.type}): effectAllowed = ${event.dataTransfer.effectAllowed}`);
event.preventDefault();
}
source.addEventListener("dragstart", event => {
event.dataTransfer.effectAllowed = "move";
write("Setting the effect allowed to move!");
});
document.body.addEventListener("dragover", writeEffectAllowed);
document.body.addEventListener("drop", writeEffectAllowed);
</script>
Vishnu
Setting effectAllowed to 'copy' or 'move' has no effect in safari. The effectAllowed is always copyMove
Devon Govett
This is still a problem. The behavior is slightly different on macOS and iOS:
* On macOS, effectAllowed is always "copyMove" in the dragover event regardless of what was set during dragstart, unless a modifier key is set, in which case it is filtered to either copy or move. This also means that dropEffect can never be set to "link", and holding the Control key results in effectAllowed being set to "none" rather than "link".
For drags initiated outside the browser, e.g. in Finder, effectAllowed is always "all" rather than "copyMove", and "link" operations work as expected.
* On iOS, effectAllowed is always "all". Modifier keys have no effect.
Ahmad Saleem
*** Safari Technology Preview 188 ***
Copymove
*** Chrome Canary 123 ***
Does not allow 'text' selection but show 'move' when selected
*** Firefox Nightly 124 ***
Does not show any text like `copy move` or `move` but just:
>> Setting the effect allowed to move!
____
Just wanted to share up-to-date test results.