e-oj / Magic-Grid

A simple, lightweight Javascript library for dynamic grid layouts.
https://www.npmjs.com/package/magic-grid
MIT License
3.14k stars 144 forks source link

Fixes numCols calculation to allow for full container width responsive implementations #42

Open stevenamoody opened 4 years ago

stevenamoody commented 4 years ago

In order to have a responsive layout that takes up the full width of the container, the numCols calculation should take into account the extra gutter space. See the test I added in test/grid-responsive.html

stevenamoody commented 4 years ago

somehow i goof'd in branching here. i'll figure it out and reopen

stevenamoody commented 4 years ago

Reopened, I originally branched from master and it appears your dev branch has diverged from master. Targeting master as the base to illustrate my changes but let me know and I can re-target to dev if you'd like to merge there.

pbowyer commented 2 years ago

Confirmed as working. Demo using this PR: https://jsfiddle.net/pbowyer/x371k5nu/2/ And the same demo using the main branch: https://jsfiddle.net/pbowyer/x371k5nu/3/