vaheqelyan / svelte-grid

A responsive, draggable and resizable grid layout, for Svelte.
https://svelte-grid.now.sh/
MIT License
948 stars 57 forks source link

`getComputedCols` Reacts to `Cols` #61

Closed JoeDailey closed 3 years ago

JoeDailey commented 3 years ago

I spent quite a bit of time debugging an issue where Grid was not updating with the cols property. When the new value has breakpoints, xPerPx will be NaN. This is not the case with simple values for cols and is likely how this bug was never caught before. JS will allow arithmetic with arrays containing only one value. image

Example of how this breaks: https://svelte.dev/repl/114f508411f64d539d5a0fe252c6c30f?version=3.30.0