vue-screen icon indicating copy to clipboard operation
vue-screen copied to clipboard

fix extendGrid breakpoint issue

Open raducal opened this issue 3 years ago • 1 comments

Hi

I've experienced a couple of issues when using extendGrid and thought I'd try fixing them

Issue 1: Passing in a number or string value when extending the grid causes the grid.breakpoint value to always be equal to the extended value e.g

const grid = useGrid(extendGrid('tailwind', {
 xs: 500,
})

grid is now equal to the object below no matter what the screen size is

{ breakpoint: 'xs', xs: true, sm: true, md: true, lg: false, xl: false, 2xl: false }

Issue 2: Passing in a ComputedBreakpoint function causes the grid.breakpoint to be an empty string when the conditions are met. I'd expect the value of grid.breakpoint to be equal to the extended property

const grid = useGrid(extendGrid('tailwind', {
 xs: (grid) => !grid.lg,
})

raducal avatar May 25 '22 12:05 raducal

Hey, let me know if there's anything you'd like me to change or fix

raducal avatar Jun 03 '22 21:06 raducal

Hello @raducostica , sorry for responding almost after a year but life took over 😓 . I have published version 2.2.0 with a fix for your problem, if you are still willing to check, please test against the latest version.

reegodev avatar Mar 16 '23 22:03 reegodev