Event.target error in firefox

I am creating my own drag and drop script in html / javascript as part of my site. Everything works fine, unless I tried it in firefox. I did some debugging and found out that firefox is returning the wrong target from event.target.

Here is the important part of the code,

$(document).bind({
  'mousemove' : function(e){
     console.log(e);

+ much more code +

var obj = e.target;
 if(obj.className == "sidebarItem"){
    dt.root.handleHover(e.target);
  }else if(obj.className == "sidebarItemText"){
   dt.root.handleHover(e.target.parentNode);
  }

(I just typed this code here so that some syntax errors might occur, but you guys understood how this works)

This code gets bound when the user clicks on the div, which is β€œdraggable” and gets unbinded as soon as they release their mouse button again.

IE Chrome, div, , firefox event.target div, ( div div, , ).

----------
|a | bbbb
|a | bbbb
|a | bbbb

a =

b =, , div, firefox

- , ?

EDIT:

, div, event.target, - -y: auto; , , . , : <

+3

Source: https://habr.com/ru/post/1775991/


All Articles