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.

Drag and drop does not work in Firefox

See original GitHub issue

When I am trying to run example from https://amsik.github.io/liquor-tree/#Drag-amp-Drop in Firefox v63.0 on Windows I am getting following error in browser console:

Start dragging: MVVM Pattern dark:74:12
TypeError: n is undefined liquor-tree:formatted:1393

The undefined n refers to this line

for (var t, n = e.path, i = 0; i < n.length; i++) if (t = n[i].className || '', /tree-node/.test(t)) return n[i];

in following method:

initDragListeners: function () {
  var e,
  t = this,
  n = function () {
    window.removeEventListener('mouseup', i, !0),
    window.removeEventListener('mousemove', r, !0)
  },
  i = function (i) {
    t.$$startDragPosition || i.stopPropagation(),
    t.draggableNode && t.draggableNode.node.state('dragging', !1),
    t.$$dropDestination && t.tree.isNode(t.$$dropDestination) && (O(t.$$dropDestination.vm.$el, null), t.draggableNode.node.finishDragging(t.$$dropDestination, e), t.$$dropDestination = null),
    t.$$possibleDragNode = null,
    t.$set(t, 'draggableNode', null),
    n()
  },
  r = function (i) {
    if (!t.$$startDragPosition || (r = i, o = t.$$startDragPosition, Math.abs(r.clientX - o[0]) > 5 || Math.abs(r.clientY - o[1]) > 5)) {
      var r,
      o;
      if (t.$$startDragPosition = null, t.$$possibleDragNode) {
        if (!1 === t.$$possibleDragNode.startDragging()) return n(),
        void (t.$$possibleDragNode = null);
        t.$set(t, 'draggableNode', {
          node: t.$$possibleDragNode,
          left: 0,
          top: 0
        }),
        t.$$possibleDragNode = null
      }
      t.draggableNode.left = i.clientX,
      t.draggableNode.top = i.clientY;
      var s = function (e) {
        var t = function (e) {
          for (var t, n = e.path, i = 0; i < n.length; i++) if (t = n[i].className || '', /tree-node/.test(t)) return n[i];
          return null
        }(e);
        return t || null
      }(i);
      if (t.$$dropDestination && O(t.$$dropDestination.vm.$el, null), s) {
        var a = s.getAttribute('data-id');
        if (t.draggableNode.node.id === a) return;
        if (!t.$$dropDestination || t.$$dropDestination.id !== a) {
          t.$$dropDestination = t.tree.getNodeById(a);
          var d = T([t.draggableNode.node,
          t.$$dropDestination], t.tree.options.dnd, 'onDragFinish');
          if (!t.$$dropDestination.isDropable() || !1 === d) return void (t.$$dropDestination = null)
        }
        e = function (e, t) {
          var n = t.getBoundingClientRect(),
          i = n.height / 3,
          r = _.ON;
          return n.top + i >= e.clientY ? r = _.ABOVE : n.top + 2 * i <= e.clientY && (r = _.BELOW),
          O(t, r),
          r
        }(i, s)
      }
    }
  };
  window.addEventListener('mouseup', i, !0),
  window.addEventListener('mousemove', r, !0)
}

In Chrome it works properly.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
amsikcommented, Nov 6, 2018

Fixed

0reactions
amsikcommented, Nov 6, 2018

Updated

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Drag and Drop When It's Not Working in Firefox
What can I do if drag and drop isn't working in Firefox? · 1. Enable User Account Control (UAC) · 2. Do not...
Read more >
Drag and drop from firefox to Windows desktop stopped ...
After updating to v68 (x64) earlier today, drag and drop of pictures from Firefox to Windows desktop, stopped working. What I tried so...
Read more >
Can't Drag and Drop TO Firefox - Reddit
I just get the universal circle with a slash error. Same with a number of other forums where you can make a post...
Read more >
Why doesn't HTML5 drag and drop work in Firefox?
I'm not using jQuery, so removed the originalEvent portion and changed the format to text (or IE had issues), and it works: event....
Read more >
Fix Firefox 68's File Drag and Drop issues on Windows
To verify Launcher Process is enabled or not for your Firefox browser, launch Firefox, click on menu> Help > Troubleshooting Information and ...
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