Skip to content

Bug: Wrong row calculation when using ignoreMarginInRow: true #977

Description

@pirolito

Hello,
i'm using this nice lib in an angular 21 app with widget dashboard.
Already tested a lot of the functionalities and i ended up with an issue on the height calculation based on the rows defined by item.
With this config:
`
options: GridsterConfig = {
gridType: GridType.VerticalFixed,
margin: 20,
outerMargin: true,
minCols: 20,
maxCols: 20,
setGridSize: true,
fixedRowHeight: 20,
keepFixedHeightInMobile: true,
ignoreMarginInRow: true,
draggable: {
enabled: true
},
resizable: {
enabled: true
},
swap: false,
pushItems: true,
displayGrid: DisplayGrid.Always,
};

dashboard: GridsterItemConfig[] = [
{ cols: 13, rows: 6, y: 0, x: 0, id: 1 },
{ cols: 7, rows: 6, y: 0, x: 13, id: 2 },
{ cols: 10, rows: 10, y: 6, x: 0, id: 3 },
{ cols: 10, rows: 10, y: 6, x: 10, id: 4 },
{ cols: 20, rows: 4, y: 16, x: 0, id: 5 },
];
`

I have always my items with the wrong height.
So, for a the widget witn ID: 1
since we have 6 rows the height should be 6 * 20px (fixedRowHeight) = 120px, but actually it's rendered with 100px as you can see in the screenshot. It is subtracting a margin (20px)

Image

Is this a bug? Is there a way to fix this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions