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

How can I call Inline Toolbar for my custom block with text? #959

Closed
tokensniper opened this issue Nov 25, 2019 · 8 comments
Closed

How can I call Inline Toolbar for my custom block with text? #959

tokensniper opened this issue Nov 25, 2019 · 8 comments

Comments

@tokensniper
Copy link

Inline toolbar appears if I select some range of text in the editorjs default paragraph block. I created custom plugin that allows user to create columns with text - https://prnt.sc/q1qze4. But if I select part of a text in my custom block - inline toolbar doesn't appear. So, how can I solve this issue?
@neSpecc

@tewang1
Copy link

tewang1 commented Nov 26, 2019

same question~

@tokensniper
Copy link
Author

I recorded short video about my issue. Do not pay attention to UI, I am testing my custom plugins:)
Video - https://recordit.co/in54iciTf3

@tokensniper
Copy link
Author

tokensniper commented Nov 26, 2019

Here is the final DOM structure for editor from video:
image

@neSpecc
Copy link
Member

neSpecc commented Dec 2, 2019

@Obzhigalov You need to pass inlineToolbar: true for your tool in Editor Config. See doc: https://editorjs.io/enable-inline-toolbar

@tokensniper
Copy link
Author

@neSpecc it doesn't help( I tried it before

@neSpecc
Copy link
Member

neSpecc commented Dec 3, 2019

@Obzhigalov on the screenshot you've added, there is no contenteditable attributes on your Tool. This is the reason, why Inline Toolbar does not appear.

This restriction was added to prevent showing Inline Toolbar when a user selects any UI texts of the block, for example, labels, buttons, etc.

@neSpecc neSpecc closed this as completed Dec 7, 2019
@BensenHsu
Copy link

@Obzhigalov on the screenshot you've added, there is no contenteditable attributes on your Tool. This is the reason, why Inline Toolbar does not appear.

This restriction was added to prevent showing Inline Toolbar when a user selects any UI texts of the block, for example, labels, buttons, etc.

Hi @neSpecc, could you please share more about how to add contenteditable attributes on my customized Tool? Since I'm also experiencing the same issue.

@Parmpreet1
Copy link

Parmpreet1 commented May 2, 2023

You also have to replace inputs to div and then you have to set contenteditable=true, Example

  1. inlineToolbar must true in custom tool.
    2.<div contenteditable=true> test text test text test text</div>
    then inlineToolbar work fine in your custom block.
    It's contenteditable not work with inputs or textarea. only work with div

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants