angular-gridster2 icon indicating copy to clipboard operation
angular-gridster2 copied to clipboard

gridster-preview element display does not change if add element via store and rendering items with async pipe

Open sbabich-nix opened this issue 7 years ago • 7 comments

  1. Render gridster-items with async pipe
  2. Add item to store
  3. Delete item from store

Result gridster-item is removed, gridster-preview element still visible

sbabich-nix avatar Mar 14 '19 13:03 sbabich-nix

Same issue here , any ideas?

karloscode avatar Mar 20 '19 08:03 karloscode

I think it´s related to #317

karloscode avatar Mar 21 '19 16:03 karloscode

This works for me:

this.store.dispatch(new RemoveWidget(data.params.tab.idWidget));
          /// Try to fix Gridster Bug
          setTimeout(() => {
            let el = this.elRef.nativeElement.getElementsByTagName(
              'gridster-preview'
            );
            this.render.setStyle(el[0], 'display', '');
          }, 50);

karloscode avatar Mar 22 '19 09:03 karloscode

Same issue here. What are you attaching your ViewChild to?

Thanks

timothybean avatar Sep 10 '19 21:09 timothybean

Nevermind, I figured it out. Thanks.

timothybean avatar Sep 10 '19 22:09 timothybean

@karloscode Where did you add that workaround? I am trying to fix this issue in my project for several days and finally have some hope to do so.

This works for me:

this.store.dispatch(new RemoveWidget(data.params.tab.idWidget));
          /// Try to fix Gridster Bug
          setTimeout(() => {
            let el = this.elRef.nativeElement.getElementsByTagName(
              'gridster-preview'
            );
            this.render.setStyle(el[0], 'display', '');
          }, 50);

Klumbler avatar Sep 18 '19 09:09 Klumbler

Fixed in v20.2.4

tiberiuzuld avatar Nov 22 '25 12:11 tiberiuzuld