Skip to content

max-w cloning issue #2354

Closed
Closed

Description

@DigitagDev

Hello. It seems that I have found a bug in the object cloning area from a template to the grid. Following the example from the documentation, it is possible to observe that an element containing the attribute gs-max-w or gs-max-h, when cloned to the grid and then deleted from the grid using .trash or another class, any elements cloned by the same grid lose the gs-max-w or gs-max-h attribute. This can be observed even in the example documentation for two grids.

Bring the element to the grid and confirm that it has the max3 attr(on the dom the element lose this attr, but seems to work fine without it)
Sem título2

Removes the element from the dom dropping over a .trash class
Sem título3

Bring the same element to the grid again , and its lose the max-w.
Sem título4

Activity

  1. adumesny commented on Jun 1, 2023

    @adumesny
    Member

    good catch. yeah we don't write gs-max-w to dom as it's not used for rendering (only creation initial value).

    actually don't need to delete. inserting second one looses.

  2. adumesny commented on Jun 12, 2023

    @adumesny
    Member

    the issue was caused by this in 8.x

    protected _readAttr(el: HTMLElement): GridStackWidget {
    ...
    if (n.maxW) el.removeAttribute('gs-max-w');

    but I don't know why we don't clone the entire griditem and just the content below. related to #1840 and #2231

  3. added a commit that references this issue on Jun 12, 2023
    8856aab
  4. adumesny commented on Jun 12, 2023

    @adumesny
    Member

    fixed in next release. don't forget to doinate if you find this lib useful!

  5. adumesny commented on Oct 13, 2024

    @adumesny
    Member

    better fix in v11

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions