angular-form-builder icon indicating copy to clipboard operation
angular-form-builder copied to clipboard

Some time form builder popover does not get open

Open PradeepJaiswar opened this issue 10 years ago • 3 comments

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 ?

PradeepJaiswar avatar Aug 13 '14 09:08 PradeepJaiswar

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

anmolsharma25 avatar Sep 24 '14 16:09 anmolsharma25

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

pessotti avatar Jun 03 '15 20:06 pessotti

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;

jkerrwilson avatar Sep 21 '15 22:09 jkerrwilson