angular-form-builder
angular-form-builder copied to clipboard
Some time form builder popover does not get open
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 ?
popover is not working in firefox. its working in chrome though.
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); } });
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;