Open EinTheFrog opened 5 days ago
Was able to find a workaround:
useEffect(() => {
const image= new Image();
image.src = editor_image_src;
image.onload = () => {
setImg({
width: image.width,
height: image.height,
});
};
}, []);
Hi @EinTheFrog, thanks for reporting the issue, but I couldn't reproduce it.
I assume the <Box />
component you're using is from the @mui/material
package?
Here's what I tried: https://codesandbox.io/p/sandbox/react-lasso-select-issue-6-tccpd2
If the problem persists even in the example I provided, please provide information about the browser you're using.
Bug Description Function onImageLoad is not called sometimes and I don't know why. Sometimes it does and sometimes it doesn't, its behaviour differs even when code doesn't change.
I'm using this code snippet provided as an answer for other issue: https://codesandbox.io/p/sandbox/react-lasso-select-issue2-h92hn?file=%2Fsrc%2FApp.tsx%3A32%2C9-32%2C45
Code
My modified code version (I removed some additional UI elements for clarity):
In the removed code I saved points to savedPoints on button click so I don't think it can affect onImageLoad function in any way.
Browser Version Chrome 129 on Windows 11