My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

ionSlideDidChange,ionSlideNextEnd,ionSlidePrevEnd are not called after zoom of ion-slides ionic 4

Thomas Kertsalis's photo
Thomas Kertsalis
·Sep 20, 2019

Hi, i am using ion-slides in ionic 4.in the home.html in ion-slides html element, i attach some handlers:

(ionSlideNextEnd)="loadNext()" 
(ionSlidePrevEnd)="loadPrev()"
(ionSlideDidChange)="onSlideChanged()" 

They are called fine. However ,after i pinch , using hammerjs

//Inside the hammer events,calculates the new scale
if (ev.type == "pinch") {
scale = Math.max(.999, 
Math.min(last_scale * (ev.scale), 4));
}


if(ev.type == "pinchend"){
last_scale = scale;
}

//applies this change to the ion-slides component
transform =
"translate3d(" + posX + "px," + posY + "px, 0) " +
"scale3d(" + scale + ", " + scale + ", 1)";
if (transform) {
el.style.webkitTransform = transform;
}

They are not called anymore. I tried attaching them programmatically ,like that:

//I tried to call this method after zoom, but nothing changed.
this.mySlider.ionSlideDidChange.subscribe(progress =>     
this.onSlideChanged());

but nothing is changed. I was wondering if you could help me on this,please? Thank you in advance.