{"action":"created","issue":{"url":"https://api.github.com/repos/tiberiuzuld/angular-gridster2/issues/382","repository_url":"https://api.github.com/repos/tiberiuzuld/angular-gridster2","labels_url":"https://api.github.com/repos/tiberiuzuld/angular-gridster2/issues/382/labels{/name}","comments_url":"https://api.github.com/repos/tiberiuzuld/angular-gridster2/issues/382/comments","events_url":"https://api.github.com/repos/tiberiuzuld/angular-gridster2/issues/382/events","html_url":"https://github.com/tiberiuzuld/angular-gridster2/issues/382","id":338198276,"node_id":"MDU6SXNzdWUzMzgxOTgyNzY=","number":382,"title":"Option to disable scroll when drag/resize","user":{"login":"andrei-tatar","id":6473183,"node_id":"MDQ6VXNlcjY0NzMxODM=","avatar_url":"https://avatars1.githubusercontent.com/u/6473183?v=4","gravatar_id":"","url":"https://api.github.com/users/andrei-tatar","html_url":"https://github.com/andrei-tatar","followers_url":"https://api.github.com/users/andrei-tatar/followers","following_url":"https://api.github.com/users/andrei-tatar/following{/other_user}","gists_url":"https://api.github.com/users/andrei-tatar/gists{/gist_id}","starred_url":"https://api.github.com/users/andrei-tatar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrei-tatar/subscriptions","organizations_url":"https://api.github.com/users/andrei-tatar/orgs","repos_url":"https://api.github.com/users/andrei-tatar/repos","events_url":"https://api.github.com/users/andrei-tatar/events{/privacy}","received_events_url":"https://api.github.com/users/andrei-tatar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-04T09:25:49Z","updated_at":"2018-07-06T08:30:03Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI'm running gridster in a configuration where I have a fixed number of columns with fixed widths (same for rows). I would like to be able to disable the scroll when dragging items around or resizing them.\r\nI tried setting the following, in the config object:\r\n```\r\nscrollSpeed: 0,\r\nscrollSensitivity: Number.MAX_SAFE_INTEGER,\r\n```\r\nThe problem is that there are a lot of jump arounds and jitter whem I drag an item.\r\n\r\nI tried commenting out the scroll function from the gridsterScroll.service.ts and it works just fine, however I am not able to change the way it works since it isn't exposed in any way.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/tiberiuzuld/angular-gridster2/issues/comments/402965500","html_url":"https://github.com/tiberiuzuld/angular-gridster2/issues/382#issuecomment-402965500","issue_url":"https://api.github.com/repos/tiberiuzuld/angular-gridster2/issues/382","id":402965500,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjk2NTUwMA==","user":{"login":"PartyArk","id":1035220,"node_id":"MDQ6VXNlcjEwMzUyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1035220?v=4","gravatar_id":"","url":"https://api.github.com/users/PartyArk","html_url":"https://github.com/PartyArk","followers_url":"https://api.github.com/users/PartyArk/followers","following_url":"https://api.github.com/users/PartyArk/following{/other_user}","gists_url":"https://api.github.com/users/PartyArk/gists{/gist_id}","starred_url":"https://api.github.com/users/PartyArk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PartyArk/subscriptions","organizations_url":"https://api.github.com/users/PartyArk/orgs","repos_url":"https://api.github.com/users/PartyArk/repos","events_url":"https://api.github.com/users/PartyArk/events{/privacy}","received_events_url":"https://api.github.com/users/PartyArk/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T08:30:03Z","updated_at":"2018-07-06T08:30:03Z","author_association":"NONE","body":"This worked for me - it's a bit of a hack but the `dragMove `function is exposed so you can overwrite it without messing around with the original code. I've taken out the `checkTouchEvent `(because is causes a lot of jerkiness) and the window scrolling. Add this to the options you pass in.\r\n\r\n```\r\n        // this is a bit of a hack by disabling the checkTouchEvent and the window scrolling\r\n        // we stop all sorts of unpleaseant scrolly behaviour. compare with original code.\r\n        options.itemInitCallback = (_: GridsterItem, b: GridsterItemComponentInterface) => {\r\n\r\n            b.drag.dragMove = function (e: any): void {\r\n                e.stopPropagation();\r\n                e.preventDefault();\r\n                this.offsetLeft = this.gridster.el.scrollLeft - this.gridster.el.offsetLeft;\r\n                this.offsetTop = this.gridster.el.scrollTop - this.gridster.el.offsetTop;\r\n                this.calculateItemPositionFromMousePosition(e);\r\n            };\r\n        };\r\n```\r\n\r\n"}}
{"actor":{"display_login":"PartyArk"}}