-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Propagate move/resize events #106
Comments
@ionicsolutions, could you describe your use-case? Actually, it's pretty easy to implement and it may be really useful, but there are questions:
This answers have no right answers, so I need pretty much time to choice the better solution. |
I'm selecting a portion of an image and generate a prediction using an ML model (currently, there is an early demo publicly available here: https://test.xaidemo.de/inspection/). We would like to remove the prediction output as soon as the user moves/resizes the stencil, as it is no longer valid. I imagine that this is a somewhat common situation, e.g., let's say we show the size of the selected area next to the image. Thus, I would like to access the move and resize events emitted here:
In my use case, I do not change the stencil using methods, so I don't have a strong opinion. |
Currently you can use the following workaround:
It's not the perfect solution, but it will create the illusion of the desired result. Your feature request sounds pretty reasonable, I will try to figure out how resolve it, but I can't promise that it will be soon. Nice project, by the way. |
In this case I would recommend to set The same situation when you need to preview the image in real-time. There is the corresponding example in the documentation. Maybe, the debounce will be disabled by default in this library in the next releases. But I decided to keep it for a while, because its disabling will be very painful breaking change. |
@ionicsolutions, could you give the feedback for the workaround above? |
Hi Norserium, thanks for the hints! I haven't worked on that part of the app in the past week. I'll most likely get around to it over the next days (also the switch to 1.0) and will let you know as soon as I've tried. |
@ionicsolutions, any news? |
Sorry that it took longer than expected, we have a deadline approaching so I needed to take care of some other issues first. I've upgraded our project to 1.3.0 and tried the debounce workaround. It has the desired effect, however, I would then need to handle waiting for the moving/resizing to stop in my part of the App. We trigger a backend request once there was a change and if I turn off the debounce, my backend API gets flooded with requests (as expected). Hence, I'd still like to be able to listen to a It's not a high priority for me right now, but as I offered in my initial post I'm happy to give it a try at some point in the future and provide a PR. |
@ionicsolutions I assume there is a little misunderstanding. You can clear the results on change and then call the debounced API request (I use |
@Norserium Indeed, I didn't get that part! Thanks for pointing this out, I was able to solve it in a matter of minutes now 👍 |
Currently, the Cropper component emits the change event once the stencil has been moved/resized. I would like to receive an event when the stencil starts changing as well, e.g., a changeStarted event. As far as I can see, this could be accomplished by propagating the move and resize events emitted by the stencil component.
If this is something you're interested in, I'm happy to provide a PR for it.
The text was updated successfully, but these errors were encountered: