Skip to content

Cropper replace throwin an exception, after second call #354

@justasxz

Description

@justasxz

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 , 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions