ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

Dragging initial offset issue with Polymer #520

Open phillip-elm opened 9 years ago

phillip-elm commented 9 years ago

Note: This question involves polymer 0.5, but doesn't require working knowledge of it

Hi there. I've got a gridster element in a polymer web component. It looks great and I'm loving the library so far.

The only issue is that when I start dragging a grid element, it moves right and down to exactly the margin-left and margin-top of the parent div.gridster element. So, in essence, if the margins are 100px top and 200px left, when I start dragging a tile, it moves 100px down and 200px right of where I started dragging it.

What makes it worse is the mouse stays where I started dragging, so I have to move my mouse up and left the opposite of the offset to position it like I would had it not jumped over.

Any idea what could be causing this? I already worked around the Gridster CSS injection / shadow DOM issues by taking the CSS it generates and putting it into a stylesheet.

Thanks in advance.