Hmmer.js pan direction is not working as expected


#1

The logic we are using is:
a) on press start drag behavior and listen to pan events
b) after press and start drag behavior set supported directions to ALL
c) ater drag finished or drop set directions to initial direction

We have to set direction because on ionic default direction for components is only left-right and there is now support of up and down.

This is a snippet of our code

@Directive({
    selector: '[la-draggable]'
})
....
    ngAfterViewInit() {
        this.hammer = new window['Hammer'](this.srcElement);
        this.defaultDirection = this.hammer.get('pan').options.direction;

        this.hammer.on('press', (ev) => {
            this.onPress(ev);
        });

        this.hammer.on('panmove', (ev) => {
            if (this.isDragging) {
                this.onPanMove(ev);
            }
        });
.....
 private onPress(ev) {
        this.hammer.get('pan').set({ direction: window['Hammer'].DIRECTION_ALL });
        // start drag&drop with custom logic
.....

The drag&drop functionallity we implemented is working well, but there is a problem on the DIRECTION_ALL, after setting this in onPress we logged the direction and it is sett well.

The problem is, if first PAN (move) we do is to the left or right anything is fine we can drag it on every point of the screen, and any events pan/panright/panleft/panup/pandown/pressup are notified.
But if we the first PAN (move) we do is to the down or to the up, no event is notified and also moving left right or pressup is never notified from then. So I think this should not a Hammer.js problem but a combination from ionic and hammer.js.

Mainly the thing we do is comming from Josh Morony drag drictive example, you can have a look here

Other information:
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/usr/lib/node_modules)
    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:
    cordova (Cordova CLI) : 7.0.1 

local packages:
    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.7.1

System:
    Android SDK Tools : 26.1.1
    Node              : v6.11.3
    npm               : 5.4.2 
    OS                : Linux 4.10

Misc:
    backend : legacy