swiety85 / angular2gridster

Angular implementation of well known Gridster (no jQuery, no external libraries, only Angular and Rx.js).
https://swiety85.github.io/angular2gridster/
MIT License
203 stars 75 forks source link

Demo: Dragging and resizing of grid items not working with newest ng and ng-cli versions #68

Closed AlMuIssues closed 7 years ago

AlMuIssues commented 7 years ago

Please create new angular project( I tried it with this versions ): angular/cli: 1.2.1 node: 8.1.0 os:linux64 angular/...:4.2.6 angular/compiler:4.2.6 angular/language-service: 4.2.6

Put your demo code inside and run the application. Problem on PC( Chrome and Firefox ):
Drag&Drop behavior: drap a grid item and drop it anywhere in gridster. The item stays at the position where droped, he doesn't take automatically position in the grid. Resize behavior: by resizing the item its size not fit the size of lanes. After resizing the mouse position is still connected with grid item. Click without the item resolve the connection and caused automatically item resizing.

swiety85 commented 7 years ago

I was able to reproduce this problem. I will fix it as soon as possible. Thanx for info.

swiety85 commented 7 years ago

This was really strange issue. There were some breaking changes about how Rx.js publishes DOM events. Regardless of that I found the solution. Fix is in v.0.6.3. Please check it, and give a hint if it works for you.

AlMuIssues commented 7 years ago

It works fine in v.0.6.3. Thanks....

tssobe commented 7 years ago

Hi It works now but after some drags the grid freezes and it is not possible to drag an item. Anyone else have this issue? This is from console: TypeError: Cannot set property '1' of undefined at GridList.markItemPositionToGrid (gridList.js:353) at GridList.generateGrid (gridList.js:42) at new GridList (gridList.js:14) at GridsterService.initGridList (gridster.service.js:47) at GridsterService.start (gridster.service.js:38) at GridsterComponent.ngAfterViewInit (gridster.component.js:50) at callProviderLifecycles (core.es5.js:11180) at callElementProvidersLifecycles (core.es5.js:11155) at callLifecycleHooksChildrenFirst (core.es5.js:11139) at checkAndUpdateView (core.es5.js:12244) Thanks

swiety85 commented 7 years ago

Send me please your config objects for Gridster. I will try to reproduce your problem.

tssobe commented 7 years ago
public gridsterOptions: IGridsterOptions = {
    lanes: 8,
    direction: 'vertical',
    widthHeightRatio: 1,
    dragAndDrop: false,
    resizable: false,
};

public itemOptions = {
    minHeight: 2,
    defaultWidth: 1,
    defaultHeight: 1,
    maxWidth: 8,
    maxHeight: 3
}

But I also change synamically the w,h and dragAndDrop and resizable

sudhakar-sekar commented 6 years ago

Hi @tssobe,

I am also facing same problem. I am using v1.5.1. Please guide me how to resolve the above issue?