a5hik / ng-sortable

AngularJS Library for Drag and Drop, supports Sortable and Draggable. Supports Touch devices.
http://a5hik.github.io/ng-sortable/
MIT License
1.15k stars 314 forks source link

Issue on dragging, #163

Closed juanpasolano closed 8 years ago

juanpasolano commented 9 years ago

Image of Yaktocat

As you can see the dragging is not longer working, but it was before! It does the normal dragging of the image, but the others don't move to make space.

At first I thought it was the new chrome 43, but it is happening in Safari and Firefox. I was in 1.1.7 of ng-sortable so I tried updating to 2.2.1 but didn't fix it. I went to 1.1.9 but nothing.

This is my bower deps in case you know of any compatibilities I don't.

"dependencies": {
    "angular": "~1.3.5",
    "angular-animate": "~1.3.5",
    "angular-sanitize": "~1.3.5",
    "angular-ui-router": "0.2.13",
    "angular-bootstrap": "~0.12.0",
    "angular-google-maps": "~2.1.0",
    "ngstorage": "~0.3.0",
    "ngtoast": "~1.4.0",
    "ng-file-upload": "~1.6.5",
    "angular-ui-select": "~0.11.2",
    "highcharts-ng": "~0.0.7",
    "angular-bootstrap-colorpicker": "~3.0.8",
    "moment": "~2.8.4",
    "lodash": "~2.4.1",
    "angulartics": "~0.17.1",
    "angular-smart-table": "~1.4.11",
    "card": "~0.1.4",
    "angular-input-masks": "~1.3.1",
    "angular-seo": "*",
    "ng-sortable": "1.1.9",
    "dw-bxslider-4": "~4.2.3"
}

This is my jade template

ul.uploaded-file.uploaded-file-grid.feature-first(as-sortable="config.sortable", ng-model='property.photos')
  li.draggable.align-center(as-sortable-item, ng-repeat='image in property.photos')
    img.full-width(ng-src="{{image.small}}", as-sortable-item-handle)
    a.btn.btn-sm.btn-danger.icon-bin-2(ng-click="removeImage($index)", href="javascript:;", tooltip="Borrar")

And my config object, which I pass to as-sortable

{
  orderChanged: function (event) {
    $scope.update();
  }
}
a5hik commented 9 years ago

When it was working last time, and what changes you have done after that? Are you able to get it back working after you revert your changes?

I do not see any problem happening with the demo app with the latest release version. It should be some specific code on your environment causing this.

Any errors on console you can share?

juanpasolano commented 9 years ago

There are no errors on the console. And it was working last week. good idea, i will get back with my repo to see if it works.

juanpasolano commented 9 years ago

I went back like 15 days into my repo and the issue is still there. And no logs to report.

I isolated the issue in this plunkr. Move some around to see the issue. Update: Please let me know if you see the error. I have checked a friends Chorme 40 and it works

lorvaltar commented 9 years ago

This is happening for me too, i just downloaded this plug in.

Mozilla firefox for ubuntu 38.0 Google chrome Version 43.0.2357.65 (64-bit) IE 11

juanpasolano commented 9 years ago

@lorvaltar good to know is not only me

juanpasolano commented 9 years ago

As for Chrome 43.0.2357.81 It seems like the issue is gone. :smile: Safari 8.0.6 (10600.6.3) still there. Firefox 38.0.1 still there

lorvaltar commented 9 years ago

Still not working for me, for some reason i can't get through this if:

if (Math.abs(eventObj.clientX - startPosition.clientX) + Math.abs(eventObj.clientY - startPosition.clientY) > 0) { unbindMoveListen(); dragStart(event); }

a5hik commented 9 years ago

Guys, I had the gh-pages (demo) updated. do you see any problem with that.

fluxonfire commented 9 years ago

Setting pointer-events: none for the img tags in css fixed the issue for me (tested in the plunkr provided above).

lorvaltar commented 9 years ago

I added a div over the image, that fixed for me

juanpasolano commented 9 years ago

@coldasflux pointer-events:none worked for me too. thanks @a5hik I think your demos never failed so i am thinking is the image that is the issue since the fix from coldasflux worked.

a5hik commented 9 years ago

pointer-events: none is already part of drag class by default. Is that not getting applied or overridden?

fluxonfire commented 9 years ago

@a5hik: pointer-events is on the drag element only, afaik. I put it on .as-sortable-item img overall, cause it fixed another issue for me too (#88).

@juanpasolano: Must be the img somehow. Seems to me like the image is dragged in FF instead of the dom-container for it.