editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

[Bug] Making editor readonly permanently removes the Block Tune toolbox

Open wgprojects opened this issue 3 years ago • 2 comments

Making editor readonly permanently removes the Block Tune toolbox (even if you make it read-write later) It also appears to cause an infinite loop of errors: Uncaught TypeError: this.nodes.toolbox is null

These issues appear to be new since version 2.23.2

Steps to reproduce:

  1. editor.readOnly.toggle(true);
  2. Observe errors
  3. editor.readOnly.toggle(false);
  4. Observe block tune UI does not return.

Expected behavior: A. No repeating errors in the console B. Block tune UI should reappear when read-write.

Screenshots: In Step 4, the ... and + menu is missing: image

In Step 2 Uncaught TypeError: this.nodes.toolbox is null value http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 l http://homestead.test/js/editor.js:2 setTimeout handler*o/t.throttle/< http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 on http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 t http://homestead.test/js/editor.js:2 l http://homestead.test/js/editor.js:2 _invoke http://homestead.test/js/editor.js:2 e http://homestead.test/js/editor.js:2 n http://homestead.test/js/editor.js:2 s http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 t http://homestead.test/js/editor.js:2 l http://homestead.test/js/editor.js:2 _invoke http://homestead.test/js/editor.js:2 e http://homestead.test/js/editor.js:2 n http://homestead.test/js/editor.js:2 s http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 t http://homestead.test/js/editor.js:2 l http://homestead.test/js/editor.js:2 _invoke http://homestead.test/js/editor.js:2 e http://homestead.test/js/editor.js:2 n http://homestead.test/js/editor.js:2 s http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 promise callback*t/</< http://homestead.test/js/editor.js:2 t http://homestead.test/js/editor.js:2 l http://homestead.test/js/editor.js:2 _invoke http://homestead.test/js/editor.js:2 e http://homestead.test/js/editor.js:2 n http://homestead.test/js/editor.js:2 s http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 value http://homestead.test/js/editor.js:2 t http://homestead.test/js/editor.js:2 l http://homestead.test/js/editor.js:2 _invoke http://homestead.test/js/editor.js:2 e http://homestead.test/js/editor.js:2 n http://homestead.test/js/editor.js:2 s http://homestead.test/js/editor.js:2 promise callback*n http://homestead.test/js/editor.js:2 s http://homestead.test/js/editor.js:2 promise callback*n http://homestead.test/js/editor.js:2 s http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 exports http://homestead.test/js/editor.js:2 promise callback*t http://homestead.test/js/editor.js:2 t http://homestead.test/js/editor.js:2 <anonymous> http://homestead.test/js/user.js:8

Device, Browser, OS: Desktop/Firefox/Windows 10

Editor.js version: 2.24.3

Plugins you use with their versions: [email protected] [email protected] [email protected] [email protected]

Configuration:

tools: {
        /**
         * Each Tool is a Plugin. Pass them via 'class' option with necessary settings {@link docs/tools.md}
         */
		paragraph: {
		  class: Paragraph,
		  inlineToolbar: ['bold', 'italic'],
		},
        header: {
          class: Header,
          inlineToolbar: [],
          config: {
            placeholder: 'Chapter',
			levels: [1],
			defaultLevel: 1
          },
          shortcut: 'CMD+SHIFT+C'
        },
        /**
         * Or pass class directly without any configuration
         */
        image: {
          class: SimpleImage,
          inlineToolbar: [],
        },
        
        delimiter: Delimiter,
        //quote: Quote,
      },

wgprojects avatar Jun 16 '22 15:06 wgprojects

You know, it looks like step 1 isn't even required to prevent the UI from showing. Without making the editor read-only, just doing editor.readOnly.toggle(false); triggers the issue.

wgprojects avatar Jun 16 '22 15:06 wgprojects

Thanks for the report

neSpecc avatar Jun 16 '22 18:06 neSpecc