Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when opening menu if a different menu is already open #132

Closed
lmonilsson opened this issue Apr 15, 2013 · 5 comments
Closed

Error when opening menu if a different menu is already open #132

lmonilsson opened this issue Apr 15, 2013 · 5 comments
Labels

Comments

@lmonilsson
Copy link

I have a few times got an error when trying to open a menu when a different menu is already open.

The following error occurs in the layerClick handler:

TypeError: Floating-point value is not finite:
  target = document.elementFromPoint(x - $win.scrollLeft(), y - $win.scrollTop())

x = e.pageX and y = e.pageY are undefined here, as the layer click actually comes from the following line in show:

// hide any open menus
$('#context-menu-layer').trigger('mousedown');

I haven't noticed the error before, so the behaviour (treating the situation as a non-silent error) may be a result of changes made in Firefox 20.

@rodneyrehm
Copy link
Contributor

good catch! (hoping I get some time in May to fix a couple of these bugs…)

@lmonilsson
Copy link
Author

Patch proposal: https://gist.github.com/Lajnold/5404556

It wraps a bunch of menu-repositioning code in layerClick() in a "fakeClick" condition.

@rodneyrehm
Copy link
Contributor

can you re-post that without the white-space noise?

@lmonilsson
Copy link
Author

I've updated the Gist.

@lmonilsson
Copy link
Author

I previously used the appendTo option to make the menus children to other elements. I'm no longer using appendTo, and I can't seem to reproduce the problem. So it may only be reproducible when using appendTo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants