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

Some time form builder popover does not get open #42

Open PradeepJaiswar opened 10 years ago

PradeepJaiswar commented 10 years ago

Hi , Some time my form builder edit option popover window does not get open and clicked input box flicker a bit.is i am missing something ?

anmolsharma25 commented 10 years ago

popover is not working in firefox. its working in chrome though.

pessotti commented 9 years ago

I think I have found the bug. Sometimes 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.

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); } });

jkerrwilson commented 9 years ago

Fix worked for me. For clarity of those that might want to fix this in the src rather than dist you add at line 25 of drag.coffee (var declarations)

    @mx = 0;
    @my = 0;

And at line 39 of the same file (mousemove listener):

if e.pageX == @mx && e.pageY == @my
    return
@mx = e.pageX;
@my = e.pageY;