Skip to content

Conversation

@pablosichert
Copy link
Contributor

Hey there,

this PR fixes a bug when using the itemClass option and dragging an item. The placeholder also needs the default itemClass (to be consistent with the behavior of items placed on the grid).

@adumesny adumesny merged commit 18fddf2 into gridstack:develop Nov 22, 2020
@adumesny
Copy link
Member

adumesny commented Nov 22, 2020

thanks for the fix. I supposed if you set opts.itemClass to something other than grid-stack-item we still need grid-stack-item in the DOM as the CSS is still dependent on that. I think addWidth() will also need to add this.ops.itemClass to this code

doc.body.innerHTML = '<div class="grid-stack-item"><div class="grid-stack-item-content">${content}</div></div>';

if you don't mind doing that and testing that out.

@pablosichert pablosichert deleted the fix/placeholder-item-class branch November 22, 2020 04:02
@pablosichert
Copy link
Contributor Author

addWidget

calls

makeWidget

calls

_prepareElement

which sets this.opts.itemClass.

So I think it should be fine now without further modifications.

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

Successfully merging this pull request may close these issues.

2 participants