os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
31 stars 31 forks source link

Dragover event intercepted preventing further propagation #148

Closed josephjeno closed 3 years ago

josephjeno commented 3 years ago

I am unable to use the ondragover handler on any elements within osjs. During my dragover, the inside variable below is always true and the early return is never hit, so the ondrag isn't propagated down to my lonely, sad little handler :worried:

dnd.js: 222

  const dragover = ev => {
    ev.preventDefault();

    const inside = el.contains(ev.target);

    if (!inside) {
      el.classList.remove('osjs__drop');
      return false;
    }

    ev.stopPropagation();
josephjeno commented 3 years ago

By the way, drop, dragstart, dragend.. all work just fine. dragover is the only one I'm having issues with.

andersevenrud commented 3 years ago

Found the commit where we worked around another similar issue: https://github.com/os-js/osjs-client/commit/5c166ab04ae3438f91101ab671da6800a42ed87e

andersevenrud commented 3 years ago

Could you provide a minimal example on how to reproduce this issue ?

josephjeno commented 3 years ago

Actually, I can't, because I haven't been able to replicate the issue with the minimal example. 🤦

josephjeno commented 3 years ago

I'll pick it back up tomorrow and probably close my issue. Sorry man. Something is intercepting my handler, that's for sure...

andersevenrud commented 3 years ago

You figured it out ? :thinking:

josephjeno commented 3 years ago

I've surrendered for now, but since I can't reproduce it outside of my environment, I'm fairly sure osjs isn't the issue.

I had a breakpoint on the dragover event, which hit the osjs dnd.js file and then disappeared into the void, which is why I had it pegged as osjs. I suppose the next step is removing that piece of code and going from there, but that will have to wait for now.

One thing's for sure, debugging these is a total... drag heh.

andersevenrud commented 3 years ago

I see. Did you get any clues as to which element the event was triggered on ? That would pretty much explain if it's os.js or not immediately :)