question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modifier keys accidentally can overwrite dropEffect set in useDrag

See original GitHub issue

Describe 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.

Reproduction https://codesandbox.io/s/github/react-dnd/react-dnd/tree/gh-pages/examples_hooks_js/05-customize/drop-effects?from-embed

Steps to reproduce the behavior:

  1. Open https://codesandbox.io/s/github/react-dnd/react-dnd/tree/gh-pages/examples_hooks_js/05-customize/drop-effects?from-embed
  2. 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.
  3. 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 Screen Recording 2019-08-09 at 12 47 30 2019-08-09 12_48_18

Desktop:

  • OS: macOS Mojave 10.14.5 (18F203)
  • Browser Google Chrome Version 76.0.3809.100 (Official Build) (64-bit)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
designbyadriancommented, Dec 10, 2019

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?

0reactions
blaues0ckecommented, Dec 13, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found