-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Not receiving correct values from get_cell_from_pixel() #237
Labels
Milestone
Comments
@DeadlyBrad42 - apologies for the very long delay, but we're giving gridstack more attention now, and, as such, have added in the parameter you've recommended. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am attempting to use
get_cell_from_pixel()
to implement dragging and dropping items from another list to add them to my grid, but I'm not getting back the values I expect.I'm passing in a position relative to the document, but since
get_cell_from_pixel()
internally compares that againstthis.container.position()
(and since my grid is in a div withposition:relative
) the calculation is off.From the name, I had assumed the function worked from a pixel position relative to the document. I was wondering if there was a reason you used
this.container.position()
instead ofthis.container.offset()
? Or if there is, is it possible to add in an optional argument that would usethis.container.offset()
? If it's a feature you'd be interested in adding, I could implement it and create the PR myself if you'd like.The text was updated successfully, but these errors were encountered: