Giter VIP home page Giter VIP logo

Comments (24)

shriah avatar shriah commented on June 12, 2024 10

I think this is because the drag actions does not get paused by chrome once the debug point is hit. Once you release the dragged item the state is set with a null dragged item, because no item is being dragged.

from react-dnd-html5-backend.

spncrlkt avatar spncrlkt commented on June 12, 2024 1

@shem86 I had the same issue. If I broke at the line and tried monitor.getItem(), it returned null.

However, if I console.log(monitor.getItem()); it logs the expected item value.

¯_(ツ)_/¯

from react-dnd-html5-backend.

subash1 avatar subash1 commented on June 12, 2024 1

really.. but unfortunately it not does for me

from react-dnd-html5-backend.

gaearon avatar gaearon commented on June 12, 2024

I can't reproduce this in Chrome 47 on OS X.
Do you have the issue on Chrome 47 on Windows?

from react-dnd-html5-backend.

jasonslyvia avatar jasonslyvia commented on June 12, 2024

I can reproduce this in Chrome 47 on OS X, while Firefox 42 on OS X works fine.

Please try this demo https://github.com/jasonslyvia/bi-demo

from react-dnd-html5-backend.

gaearon avatar gaearon commented on June 12, 2024

@jasonslyvia Do you get the crash or is it just item being null? Are you running 2.0.2?

from react-dnd-html5-backend.

gaearon avatar gaearon commented on June 12, 2024

@jasonslyvia In your example you have "react-dnd-html5-backend": "^2.0.0",. Any chance it installed 2.0.0 instead of 2.0.2?

from react-dnd-html5-backend.

jasonslyvia avatar jasonslyvia commented on June 12, 2024

@gaearon

When in 2.0.0, I get null for drop(props, monitor, component) when I call monitor.getItem().

In node_modules/ it did installed version 2.0.0 for react-dnd-html5-backend, and switched to 2.0.2 everything works. Thanks a lot!

from react-dnd-html5-backend.

mordrax avatar mordrax commented on June 12, 2024

I'm getting this same issue with the following setup:

Ubuntu 14.04
Chrome Stable 48.0.2564.116 (64-bit)
"react-dnd-html5-backend": "^2.1.2"

Works with Firefox: 43.0

from react-dnd-html5-backend.

gaearon avatar gaearon commented on June 12, 2024

@Mordra Do you have errors in console?

from react-dnd-html5-backend.

mordrax avatar mordrax commented on June 12, 2024

No errors, it just returns null when I break at the line:
let source = monitor.getItem();

Then I played around with installing chrome unstable via shell and even though the version still shows 48.0.2564.116, it then just started working again... (i.e source had the expected object from beginDrag)

So I don't know what's going on, really frustrating and it wasn't the first time that I encountered this. Last time took me on a wild goose chase as well but at least now I know it's browser issues.

from react-dnd-html5-backend.

shem86 avatar shem86 commented on June 12, 2024

I had the same issue on chrome on win7
"react-dnd-html5-backend": "^2.1.2"

latest chrome updates (48.0.2564.116 m, 49.0.2623.75 m)
seems to have fixed it.

from react-dnd-html5-backend.

gaearon avatar gaearon commented on June 12, 2024

Can you please screenshot the error message in console?

from react-dnd-html5-backend.

shem86 avatar shem86 commented on June 12, 2024

No errors, it just returns null when I break at the line:
let source = monitor.getItem();

from react-dnd-html5-backend.

subash1 avatar subash1 commented on June 12, 2024

hooray.. here is the same..
in windows, in Firefox 37.0.2 is working.
but in chrome 49.0.2 does not..

from react-dnd-html5-backend.

jamieholliday avatar jamieholliday commented on June 12, 2024

I can confirm I have the same issue in chrome 49.0.2623.87
console.log(monitor.getItem()); logs the correct item but adding a breakpoint at the same point in the file monitor.getItem() is null

from react-dnd-html5-backend.

harjis avatar harjis commented on June 12, 2024

I had the same problem. To me it seemed that END_DRAG was somehow executed before DROP. When I commented out this line: https://github.com/gaearon/dnd-core/blob/master/src/reducers/dragOperation.js#L50 it seemed to fix the problem. After that I removed the whole node_modules content (since I had console logs in other places too) and installed everything again and for some reason this seemed to fix the issue as well. Weird 😕

I have Chrome Version 50.0.2661.102 (64-bit) on OSX

from react-dnd-html5-backend.

m4recek avatar m4recek commented on June 12, 2024

Same on Chrome version 51.0.2704.84m, Windows 7 64bit using [email protected]

from react-dnd-html5-backend.

loki951753 avatar loki951753 commented on June 12, 2024

+1

Version 51.0.2704.63 (64-bit)
Ubuntu14.04
[email protected]

from react-dnd-html5-backend.

gtp avatar gtp commented on June 12, 2024

just had the same situation, seems like possibly the second time you access monitor.getItem() it returns null, so a console.log before it can cause the problem. I removed all lines before the call to getItem and that fixed it for me.

from react-dnd-html5-backend.

sunnipaul avatar sunnipaul commented on June 12, 2024

Thank you for this wonderful react-dnd.

I am having the same issue on google chrome 51.0.2704.103 m, windows 10.
"react-dnd": "2.1.4",
"react-dnd-html5-backend": "2.1.2"

I log it here:

@DropTarget([ItemTypes.OPP_LIST, ItemTypes.ITEM], dropTarget, (connect, monitor)=>{
    let item = monitor.getItem();
    console.log(item );
    return {
       isDragging: !!item
   }
}

It will log about 10 lines of the correct item, then multiple lines of null, when dragging
However, it works fine in Firefox 46.0.1
Finally, I figured it out, it's because I have a Dustbin at the beginning of the draggable items who will show up when I am dragging one item.
If I remove the Dustbin or put it at the end of the list, it works fine. It seems the show up of the Dustbin is doing bad on the underlining mechanism and Firefox can skip it.

from react-dnd-html5-backend.

kevalbhatt avatar kevalbhatt commented on June 12, 2024

@shriah you saved my time thanks 👍

from react-dnd-html5-backend.

dandonahoe avatar dandonahoe commented on June 12, 2024

@shriah Weirdest bug I've ever seen. THANK YOU.

Ironic that using debugger causes the bug.

from react-dnd-html5-backend.

 avatar commented on June 12, 2024

I encountered the same issue. When I debug using Chrome, I get null for monitor.getItem(). Any idea if Chrome team is aware of this issue?

from react-dnd-html5-backend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.