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

sey-list incorrectly positioned when using appendTo #35

Closed
josephschmitt opened this issue Mar 14, 2016 · 4 comments
Closed

sey-list incorrectly positioned when using appendTo #35

josephschmitt opened this issue Mar 14, 2016 · 4 comments

Comments

@josephschmitt
Copy link

If you use the appendTo function to append the sey-list to something other than document.body, the left and right properties of the list are being set as if the list was still being appended directly to the body. This is easiest to see if you position an element that wraps the input field somewhere on the page, then set appendTo to point to that element. You'll notice top and left are being set to the position of that wrapper, but since the list is inside that wrapper, it ends up getting offset. Example:

http://cl.ly/fPjk
http://plnkr.co/HhRlVL5RNaZwDzwistkc

@josephschmitt
Copy link
Author

I would expect top and left values to be relative to the element being appended to, not to the body when appendTo is set.

@bevacqua
Copy link
Owner

Should be fixed now.

@msokk
Copy link

msokk commented Aug 9, 2017

Top value is correct with appendTo, but left value is still calculated from body for some reason.

@msokk
Copy link

msokk commented Aug 9, 2017

Aha, bullseye only applies appendTo, context to top - https://github.com/bevacqua/bullseye/blob/master/bullseye.js#L76.

Would replacing the line 67 in bullseye with

el.style.left = (context ? p.x - context.getBoundingClientRect().left : p.x) + 'px'; 

make sense?

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

No branches or pull requests

3 participants