Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seemaPatelTest opened this issue Jul 10, 2024 · 0 comments
Labels

Comments

@seemaPatelTest
Copy link

seemaPatelTest commented Jul 10, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant