-
-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Hi there,
As the title mentions, when I add readOnly: true, it give me below error
Uncaught Error: Existing toolbox is null. Can't create new toolbox. at WorkspaceSvg$$module$build$src$core$workspace_svg.updateToolbox (workspace_svg.ts:1869:13) at useBlocklyWorkspace.js:43:23
const {workspace} = useBlocklyWorkspace({ ref: blocklyRef, initialXml: programXml, toolboxConfiguration: { "kind": "flyoutToolbox", "contents": [ { "kind": "block", "type": "controls_if" }, { "kind": "block", "type": "controls_whileUntil" } ] }, workspaceConfiguration: { renderer: 'crc_renderer', readOnly: true, scrollbars: true, trashcan: false, grid: { spacing: 20, length: 3, colour: '#ccc', snap: true, }, media: '/blockly/media/', }, onDispose: (ws) => logger.info('on ws dispose', ws), // @ts-ignore onInject: (ws) => logger.info('injected ws', ws?.undoStack_), onWorkspaceChange: (ws) => logger.info('on ws change', ws), onImportXmlError: (error) => logger.warn('error importing XML', error) })