Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The 'addWidget' function ignores data attributes #1276

Closed
AlexanderSokolov1 opened this issue May 15, 2020 · 2 comments
Closed

The 'addWidget' function ignores data attributes #1276

AlexanderSokolov1 opened this issue May 15, 2020 · 2 comments

Comments

@AlexanderSokolov1
Copy link

Subject of the issue

The data attributes are ignored during adding new widgets through the addWidget function with specified coordinates.

Your environment

  • gridstack version: 1.1.1
  • browsers: any

Steps to reproduce

https://jsfiddle.net/Alexander_Sokolov/tu03kbgv/24/

  • initialize the Grid with column=4
  • prepare the widget HTML with an attribute data-gs-width="3"
  • use the addWidget function to add new widget to the grid container with x and y coordinates:
    grid.addWidget(htmlElement, 0, 0);

Expected behaviour

The widget width is initialized from the HTML attribute (like it was in v0.4)

Actual behaviour

The data-gs-width attribute is ignored

adumesny added a commit to adumesny/gridstack.js that referenced this issue May 15, 2020
@Wenish
Copy link

Wenish commented May 15, 2020

Yeah i have the same problem but with data-gs-min-width="4"
The grid gets i a really buggy state. the item is width 1 but it displays it as it would be 4. so items overlap.
bug

The is also the problem with the min-width in this example: https://gridstackjs.com/demo/two.html#

adumesny added a commit to adumesny/gridstack.js that referenced this issue May 17, 2020
@adumesny
Copy link
Member

fixed in 1.1.2

adumesny added a commit that referenced this issue May 17, 2020
fix 'addWidget' ignores data attributes #1276
adumesny added a commit to adumesny/gridstack.js that referenced this issue May 17, 2020
adumesny added a commit that referenced this issue May 17, 2020
TS: fix 'addWidget' ignores data attributes #1276, 1.1.2 release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants