Skip to content

When Editor is on readonly' mode editor throw warning "EventDispatcher .off(): there is no subscribers for event" #2772

@seemaPatelTest

Description

@seemaPatelTest

If Editor.js has 'readonly' mode true, then console tab display warning
EventDispatcher .off(): there is no subscribers for event "editor mobile layout toggled". Probably, .off() called before .on()

Expected behavior:
No warning will display for read only mode

Screenshots:
image

I tested this on vue3 project. Below is code snippet

import { onMounted, ref } from 'vue'
import EditorJS from '@editorjs/editorjs'
import Header from '@editorjs/header'

const editorInstance = ref()

onMounted(() => {
  const editorEl = document.getElementById('editorJs')
  if (!editorEl) return
  editorInstance.value = new EditorJS({
    holder: editorEl,
    readOnly: true,
    tools: {
      header: {
        class: Header,
        inlineToolbar: ['link'],
        config: {
          levels: [1, 2, 3, 4, 5, 6],
          defaultLevel: 1,
        },
      },
    },
  })
})
</script>
<template>
  <div id="editorJs">
  </div>
</template>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions