diff --git a/.codesandbox/templates/vanilla/src/index.ts b/.codesandbox/templates/vanilla/src/index.ts index 610073b6dc3..547838a0bae 100644 --- a/.codesandbox/templates/vanilla/src/index.ts +++ b/.codesandbox/templates/vanilla/src/index.ts @@ -2,7 +2,7 @@ import * as fabric from 'fabric'; import './styles.css'; const el = document.getElementById('canvas'); -const canvas = new fabric.Canvas(el); +const canvas = (window.canvas = new fabric.Canvas(el)); // edit from here canvas.setDimensions({ diff --git a/CHANGELOG.md b/CHANGELOG.md index 0920caacec9..e59ec1f1ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] +- fix(): tweaks to type getter [#9022](https://github.com/fabricjs/fabric.js/pull/9022) - ci() Refactor GHA actions for caching and reuse [#9029](https://github.com/fabricjs/fabric.js/pull/9029) - ci(): install dev deps types [#9039](https://github.com/fabricjs/fabric.js/pull/9039) diff --git a/src/filters/ColorMatrixFilters.ts b/src/filters/ColorMatrixFilters.ts index 6783f0f854b..412f9e5a071 100644 --- a/src/filters/ColorMatrixFilters.ts +++ b/src/filters/ColorMatrixFilters.ts @@ -3,10 +3,6 @@ import { classRegistry } from '../ClassRegistry'; export function createColorMatrixFilter(key: string, matrix: number[]) { const newClass = class extends ColorMatrix { - get type() { - return key; - } - static type = key; static defaults = { diff --git a/src/shapes/IText/IText.ts b/src/shapes/IText/IText.ts index 26a5a5eb093..d19c218bf12 100644 --- a/src/shapes/IText/IText.ts +++ b/src/shapes/IText/IText.ts @@ -205,7 +205,9 @@ export class IText< static type = 'IText'; get type() { - return 'i-text'; + const type = super.type; + // backward compatibility + return type === 'itext' ? 'i-text' : type; } /**