Skip to content

defaultSize does not accept or interpret calc() expressions #866

@phanvohieunghia

Description

@phanvohieunghia

When using the defaultSize prop in the component, passing a CSS calc() expression as a string does not work as expected. The component does not evaluate the calc() string and fails to apply the intended size.

Code Example:

<Resizable
    defaultSize={{ height: "calc(100vh - 21px - 60px - 56px - 2 * 4px - 4 * 16px - 4px)" }}
    ....
    >

Expected Behavior:

The component should interpret the calc() expression and set the initial height accordingly.

Actual Behavior:

The calc() value is not applied. The element either does not resize correctly or ignores the defaultSize altogether.

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