[Bug]: Abort signal not propagated from loadFromJSON() to objects in Group
Sayene opened this issue · comments
Sayene commented
CheckList
- I agree to follow this project's Code of Conduct
- I have read and followed the Contributing Guide
- I have read and followed the Issue Tracker Guide
- I have searched and referenced existing issues and discussions
- I am filing a BUG report.
- I have managed to reproduce the bug after upgrading to the latest version
- I have created an accurate and minimal reproduction
Version
6.0.0-beta20
In What environments are you experiencing the problem?
Chrome
Node Version (if applicable)
20.12.2
Link To Reproduction
https://codesandbox.io/p/devbox/fabric-nextjs-sandbox-forked-g2w22y?file=%2Fpages%2Findex.tsx
Steps To Reproduce
- see linked reproduction sandbox
- general steps below:
2.1. create AbortController(),
2.2 load canvas from JSON passing abort signal. JSON should contain objects (eg. images) inside Group
2.3 aborting with controller does not work for objects (images) inside Group, as signal is not passed to object (Image) fromObject()
Expected Behavior
signal should be passed to objects (Images) in groups
Actual Behavior
signal is not passed to objects in groups
Error Message & Stack Trace
linked reproduction uses CustomImage class, writing signal value to console in fromObject() method. for image added directly to canvas this is properly set. for image added to group it is undefined.
Sayene commented
looks like issue is here (options not passed down the stream):
https://github.com/fabricjs/fabric.js/blob/ca171ae194d307700d98d4447f29804ee37e920b/src/shapes/Group.ts#L668C7-L668C45
Andrea Bogazzi commented
Good find. If you feel like open a PR to fix it. Otherwise at some point someone will do for sure