metafizzy / outlayer

:construction_worker: the brains & guts of a layout library
163 stars 63 forks source link

Container padding gaps with percentPosition #42

Open desandro opened 9 years ago

desandro commented 9 years ago

1 Gaps will occur when layout is changed — on resize, or item size changes — with percentPosition: true AND when the container element has padding. See demo: http://codepen.io/desandro/pen/ZGdqqZ

2 Gaps in columns with percent width items and container padding. See demo http://codepen.io/desandro/pen/KpjGxr

desandro commented 8 years ago

Tried working on this today. I've found part of the problem is in Item.getPosition, calculating the current position from getComputedStyle. With testing Outlayer, it returns the previous value. For example, if container element width has changed from 400px to 500px, and item left is 10%, it returns 40px, rather than current 50px. But I cannot isolate why this is happening in Outlayer, and not in a reduced test case. See http://codepen.io/desandro/pen/5fbfef89774bd66af01cf8481a0d1349/

desandro commented 8 years ago

I was able to identify a bug in Chrome. See https://bugs.chromium.org/p/chromium/issues/detail?id=601030#