yahoo / ember-gridstack

Ember components to build drag-and-drop multi-column grids powered by gridstack.js
https://yahoo.github.io/ember-gridstack/
Other
37 stars 29 forks source link

Unable to set class on grid-stack element #91

Closed apellerano-pw closed 2 years ago

apellerano-pw commented 2 years ago

In previous versions of this lib it was possible to put a custom classname onto the parent .grid-stack element.

{{#grid-stack
  options=...
  class="MyClass"
}}

With the move to Glimmer components, this is no longer possible since the grid-stack template does not specify ...attributes.

Gridstack itself provides a way to specify class on the GridStackOptions; however it is only done in addGrid (see: https://github.com/gridstack/gridstack.js/blob/103b4a3e67c4f5205e6aa1144c95cdb48ef3862f/src/gridstack.ts#L167) which this lib doesn't use, so the option is ignored that way as well.

Couple ways I can think of to address this...

  1. Add ...attributes to the grid-stack template div
  2. Manually append this.options.class to the element during _createGridStack()
yavin-bot commented 2 years ago

:tada: This issue has been resolved in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

jkusa commented 2 years ago

@apellerano-pw thanks for reporting this issue 🙏 Check out v3.1.0 for the fix. Please let us know if you have any questions or issues with this release.