kelp404 / angular-form-builder

Drag and drop to build bootstrap forms in AngularJS.
http://kelp404.github.io/angular-form-builder/
MIT License
600 stars 340 forks source link

popup is not working in chrome browser thought its working fine in firefox and IE #81

Closed joezhouOxford closed 9 years ago

joezhouOxford commented 9 years ago

Does this happen to anymore else? I tested with http://kelp404.github.io/angular-form-builder/ and it is the same

pessotti commented 9 years ago

Sometimes it happens to me too... And it lasts until a full reboot, even if I close Google Chrome it doesn't work after opening again.

As a workaround, I'm trying to place a button to manually open the popup just in case. If anyone knows how to do it, I would be glad to know!

pessotti commented 9 years ago

I think I have found the bug. Google Chrome fires both mousemouve AND mouseclick when clicking something. When this happens, the popover doesnt open because it thinks we are trying to move a field.

pessotti commented 9 years ago

I have solved this bug by storing the mouseX and Y, comparing it every time the mouse move around.

Add the following variables after "this.mouseMoved = false;":

this.mx=0; this.my=0;

And modify the mousemove handler as below:

$(document).on('mousemove', function(e) { if(e.pageX == _this.mx && e.pageY == _this.my) return; _this.mx = e.pageX; _this.my = e.pageY; var func, key, _ref; _this.mouseMoved = true; _ref = _this.hooks.move; for (key in _ref) { func = _ref[key]; func(e); } });

joezhouOxford commented 9 years ago

thanks pesootti. Your solution works!

northoutIshan commented 7 years ago

Thanks Pessoti. It works.

vrajroham commented 7 years ago

+1

Thanks @pessoti. Saved a day

itsovereasy commented 7 years ago

Thanks @Pessotti. It really works.