Skip to content

addGrid() does not recognize rem units for cell height #1794

@cfcoder

Description

@cfcoder

Subject of the issue

I am using 10rem as my cell height in my grid. I set up for a save of the full serial data [ save(true, true) command ] into a variable fullSerialData, then without loading the page, i destroy the grid, then call the GridStack.addGrid() of that same serial name [ load(fullSerialData, true) ] and it sets the cellHeight to 10px instead of 10rem.

Your environment

  • version of gridstack.js gridstack@4.2.5 using HTML5 version
  • which browser/OS Brave Version 1.25.73 Chromium: 91.0.4472.106 (Official Build) (64-bit)

Steps to reproduce

https://jsfiddle.net/ve0sdunm/2/

  1. Run as is, it will work fine using 100px cellHeight.
  2. Change cellHeight in options to 10rem and run it again.

Expected behavior

Should set the cell height of the widget to 10rem.

Actual behavior

It instead sets it to 10px.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions