Merge pull request #19 from brianpooe/claude/angular-signals-upgrade-01LkzyeFbjsqKer2XzATwcxH

fix: Reset zoom state properly in destroy() method
This commit is contained in:
Brian Pooe 2025-11-16 16:02:11 +02:00 committed by GitHub
commit 09e5af85c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1551,6 +1551,8 @@ export class IvyPinchService {
* Destroys the IvyPinch instance.
*
* **Cleanup:**
* - Resets zoom to original state
* - Removes CSS transforms
* - Removes CSS styles
* - Destroys touch event handlers
* - Removes event listeners
@ -1560,6 +1562,14 @@ export class IvyPinchService {
* @public
*/
public destroy(): void {
// Reset zoom to initial state before cleanup
this.scale = 1;
this.moveX = 0;
this.moveY = 0;
this.element.style.transform = 'none';
this.element.style.transition = 'none';
// Clean up styles and event listeners
this.removeBasicStyles();
this.touches.destroy();
}