AllanBishop / angular-img-cropper

An image cropping tool for AngularJS. Features rectangular crop area, zooming, aspect ratios and multi-touch.
MIT License
174 stars 112 forks source link

Apparent incompatibility with Ionic #95

Closed viking2917 closed 1 month ago

viking2917 commented 7 years ago

First, thanks for this awesome component!

Does anyone have experience using this with Ionic? Without altering the code as described below, I am unable to alter the cropping box, as no mouse events seem to propagate to the component.

Steps to reproduce: Install blank ionic starter app (using Ionic command line tool): ionic start clipTest blank

add the js library for clipping into index.html insert the demo code from the home page for angular-img-cropper (attached HTML file) add the example controller code to the app.js file (attached) Archive.zip

dragging on the clip box will not do anything.

angular-img-cropper sets up event watches on various events of the form mousemove.angular-img-cropper and so on. If I edit angular-img-cropper.js to change all the event names from .angular-img-cropper to (e.g. .on('mouseup.angular-img-cropper', this.onMouseUp.bind(this)) becomes .on('mouseup', this.onMouseUp.bind(this))

it seems to work fine. But I don't know whether that has any unanticipated side effects. My hypothesis is that ionic is somehow taking over event processing and so the event targets aren't as expected.

viking2917 commented 1 month ago

very old, closing