Cropper.Blazor icon indicating copy to clipboard operation
Cropper.Blazor copied to clipboard

Cropper replace throwin an exception, after second call

Open justasxz opened this issue 1 year ago • 1 comments

Describe the bug The bug is as follows. I have a simple blazor hybrid application, that changes brightness with slider, meaning that Source is updated on every slider movement, I use MagickImage for that. I tried to combine it with blazor.cropper, I switched from to <CropperComponent>, and it stopped updating when the source changed. After some reading I found that I would need to call await cropper.ReplaceAsync(SelectedImage, true); And it works fine the first time, it updated the brightness and keeps the cropper, even if a little bit slow. But after the second brightness change it throws the following exception:

Cannot set properties of undefined (setting 'src') TypeError: Cannot set properties of undefined (setting 'src') at n.replace (https://0.0.0.0/_content/Cropper.Blazor/cropper.min.js:10:22903) at CropperDecorator.replace (https://0.0.0.0/_content/Cropper.Blazor/cropperJsInterop.min.js:1:1746) at https://0.0.0.0/_framework/blazor.webview.js:1:3050 at new Promise () at g.beginInvokeJSFromDotNet (https://0.0.0.0/_framework/blazor.webview.js:1:3007) at https://0.0.0.0/_framework/blazor.webview.js:1:48020 at EventTarget. (:7:62) at EmbeddedBrowserWebView. (:1:43721)

I believe this is a bug, but maybe I am missing something ? It feels like REplaceSync doesn't fully replace the component

justasxz avatar Aug 03 '24 11:08 justasxz

Hi @justasxz. Could you glance to the official docs. Screenshot_20240803_182635_Chrome If it isn't help you. Could you provide example of project with that problem?

MaxymGorn avatar Aug 03 '24 15:08 MaxymGorn