Modifier keys accidentally can overwrite dropEffect set in useDrag
See original GitHub issueDescribe the bug
The user is accidentally able to overwrite the dropEffect
using the ⌘ command
when the dropEffect
is “forced” by passing it in options
in useDrag
.
Steps to reproduce the behavior:
- Open https://codesandbox.io/s/github/react-dnd/react-dnd/tree/gh-pages/examples_hooks_js/05-customize/drop-effects?from-embed
- Drag the second box with the text
When I am over a drop zone, I have no icon
and press the modifier keys (⌥ option
or⌘ command
). Nothing will change as expected. - Drag the first box with the text
When I am over a drop zone, I have copy icon
and press the modifier keys (⌥ option
or⌘ command
). The “copy” mouse cursor will disappear while pressing⌘ command
. This will also allowing moving where no moving should be allowed.
Expected behavior
I expect that in the “copy” mouse cursor will stay since the user should not be allowed to change dropEffect
when its defined in options
.
Screenshots
Desktop:
- OS: macOS Mojave 10.14.5 (18F203)
- Browser Google Chrome Version 76.0.3809.100 (Official Build) (64-bit)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
DataTransfer.dropEffect - Web APIs | MDN
The DataTransfer.dropEffect property controls the feedback (typically visual) the user is given during a drag and drop operation. It will ...
Read more >501655 - When drag-and-dropping, dropEffect not updated
while dragging press the command or option modifier keys to trigger different dropEffects. What is the expected behavior? Console should show ...
Read more >EventStateManager.cpp - mozsearch - Searchfox
file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ... If the content access key modifier is pressed, try remote children. if (aExecute &&....
Read more >MOS Protocol 4.0 (Current)
Users at an NCS workstation can change MOS related data via an ActiveX control should one be provided by the Media Object Server...
Read more >Viewing online file analysis results for 'xplorer2_lite.exe'
Remote Access: Reads terminal service related keys (often RDP related); Spyware: Contains ability to open the clipboard
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not a maintainer, but I’d like to point out that it looks like you’re linking the original example, not your edit?
Yes, this is another issue: The modifier key is hardcoded to “alt” but the modifier key is actually different between macOS (alt) and Windows (ctrl). I created this (https://github.com/react-dnd/react-dnd/issues/1517) issue for that that unfortunately has been closed automatically