Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Wrong placeholder size when using jQuery & box-sizing: border-box #9

Closed
jukkakoskinen opened this issue Jul 30, 2014 · 3 comments
Closed

Comments

@jukkakoskinen
Copy link

Just noticed that the placeholder's size is determined like this:

if (this.opts.forcePlaceholderSize) {
  this.placeholder.height(dragging.el.height())
  this.placeholder.width(dragging.el.width())
}

This causes trouble when using box-sizing: border-box, since $.width() and $.height() still operate in content-box mode.

After quick testing, seems like using parseFloat(dragging.el.css('height')) works. This issue doesn't exist when using Zepto.

jQuery fiddle: http://jsfiddle.net/VT5Yz/1/
Zepto fiddle: http://jsfiddle.net/VT5Yz/2/

@rkusa
Copy link
Owner

rkusa commented Jul 30, 2014

Thanks for your effort! Do you like to make a PR?

(seems to be the same issue for touch-dnd)

@jukkakoskinen
Copy link
Author

Done. #10 & rkusa/touch-dnd#16

@rkusa
Copy link
Owner

rkusa commented Jul 30, 2014

Awesome, thanks!

@rkusa rkusa closed this as completed Jul 30, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants