desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 387 forks source link

issue #15 - Top offset in Chrome fix. #108

Closed geekdenz closed 6 years ago

geekdenz commented 8 years ago

I believe this fixes this problem in Chrome and should still work in other browsers. Haven't tested those though.

desandro commented 8 years ago

Thanks for taking a shot at this. I'm not a fan of the try/catch pattern. Instead of using getting the client rect, I was thinking of parsing the style value, checking if its a percent or not. Here's a similar pattern in Outlayer https://github.com/metafizzy/outlayer/blob/v1.4.2/item.js#L169-L172

geekdenz commented 8 years ago

I only introduced try/catch because I didn't have much time to do this and it was the quickest and safest I could think of then. But I think using the client rect is fine and actually good practice. Don't you?

desandro commented 6 years ago

I've decided to pass on this request. Thanks again for your contribution!