BUG: Error when setting defaults of an extended model
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Version 141.0.7390.123 (Official Build) (64-bit)
Reproducible demo link
https://codesandbox.io/p/sandbox/jovial-elion-js8zgy?file=%2Findex.js%3A1%2C1-15%2C1
Describe the bug
import grapesjs from "grapesjs";
import "grapesjs-blocks-basic";
const editor = grapesjs.init({
container: "#gjs",
fromElement: 1,
storageManager: { type: 0 },
plugins: ["gjs-blocks-basic"],
});
let linkType = editor.DomComponents.getType("link");
let linkTypeExtended = linkType.model.extend({
defaults: linkType.model.prototype.defaults, // offending line
});
The above worked in 0.15.x but not in 0.22.13. Any idea what is the problem?
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (1)
Hey @bilogic your demo seems to use the proper API for extending components, the one relying on .extend( was dropped a long time ago
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5922
BUG: Unable to use UI controls for the video component when
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? v125.0.6422.113 (Official Build) (64-bit)...
Issue #4116
BUG: Flex Property not working in style manager
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Version 1.34.81 Chromium: 97.0.4692.99 (Of...
Issue #5297
BUG: getJS not working
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Version 115.0.5790.171 (Official Build) (64-...
Issue #4432
BUG: Undo Manager creates Duplicate CSS during custom command
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? 103.0.5060.66 (Official Build) (64-bit) (c...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.