1

I would like to create draggable (free) buttons in Ionic. In ionic 3 I used a directive to do this (link https://www.joshmorony.com/building-an-absolute-drag-directive-in-ionic-2/) but this directive don't works in ionic 5 and it does not give any errors. What do you think is the best library (supported from some tutorial) for ionic 5 to do this? Thanks in advance.

1 Answers1

3

This does not have to be Ionic specific. If you are using angular you can just use an NPM component such as https://www.npmjs.com/package/angular-draggable-droppable

There is also support for this in Angular Material library

https://material.angular.io/cdk/drag-drop/overview

  • 1
    Thanks a lot E. Maggini. I have tried cdk drag-drop and is a very good library. There was only a runtime problem "TypeError: Class constructor Platform cannot be invoked without 'new' at Module../node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/platform.js" but I have resolved downgrading the version of the library to 9.2.4 Thanks for your help! – Salvo Rossitto Jun 30 '20 at 12:58