fabricjs / fabric.js

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser

Home Page:http://fabricjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Abort signal not propagated from loadFromJSON() to objects in Group

Sayene opened this issue · comments

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

  1. see linked reproduction sandbox
  2. 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.

Good find. If you feel like open a PR to fix it. Otherwise at some point someone will do for sure