Skip to content

Prevent user to add new blocks #784

Closed

Description

@mparfait

Hi everyone,

Is there already a way to prevent user to add a new blocks.
For example, if I decide to fill the editor with only a block header and a block paragraph, I would like to restrict the user to only edit the header and the paragraph and not to add others headers or paragraphs.

Example here :
`
const editor = new EditorJS({
holderId : 'editorjs',
tools: {
header: {
class: Header,
config: {
placeholder: 'Enter a header'
}
}
},

data : {
  blocks: [
    {
        type: "header",
        data: {
          text: "Mon titre"
        }
      },
      {
        type: "paragraph",
        data: {
          text: "Mon texte"
        }
      }          
    ],
}

});
`
Thanks !

Activity

  1. GruFFix commented on Aug 13, 2020

    @GruFFix

    Did you find how to do it?

  2. mparfait commented on Aug 14, 2020

    @mparfait
    Author

    Hello GruFFix,
    No, I've tested this tools during an R&D period and I left this project a few more days after this ticket. Maybe I will get back into this but I don't know when.

  3. CavalcanteLeo commented on Oct 18, 2020

    @CavalcanteLeo

    i'm facing the same issue, any news?

  4. elfeffe commented on Nov 16, 2020

    @elfeffe

    Is there any news about this? I also need to let my users add one header, and nothing else.

    @khaydarov Can you help?

  5. locked and limited conversation to collaborators on Jan 17, 2022
  6. converted this issue into a discussion #1899 on Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions