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

Replace built-in inline link tool with Hyperlink #17

Open
Grendaizo90 opened this issue Dec 12, 2022 · 2 comments
Open

Replace built-in inline link tool with Hyperlink #17

Grendaizo90 opened this issue Dec 12, 2022 · 2 comments

Comments

@Grendaizo90
Copy link

Grendaizo90 commented Dec 12, 2022

I tried to add your Hyperlink in my Strapi app (with strapi-plugin-react-editorjs), and after i did it, Hyperlink comes as additional tool in inline toolbox (with same icon) and seems like their behavior now is binded to each other. Now i'd like to fully replace built-in inline link tool with your Hyperlink. Do you have any ideas how can i do this?

I've added your extension through customTools.js as described HERE at the bottom of page (about extending)

I've read this issue and all links discussed in this thread, but didn't find a solution

Here's Hyperlink in inline toolbar
Снимок экрана 2022-12-12 в 15 27 52

That's what happening when i click on link tool after Hyperlink:
Снимок экрана 2022-12-12 в 15 37 09

@Grendaizo90 Grendaizo90 changed the title Replace built-in LinkTool with Hyperlink Replace built-in inline link tool with Hyperlink Dec 24, 2022
@Grendaizo90
Copy link
Author

I've found a workaround.
In customTools.js i wrote:

hyperlink: {
    class: Hyperlink,
    // ... code here
},
// solution below
link: function() {}

@bettysteger
Copy link

@Grendaizo90 i think you just need to set inlineToolbar in the EditorJS config:

so instead of

new EditorJS({
    inlineToolbar: ['bold', 'italic', 'underline', 'link']

set this:

new EditorJS({
    inlineToolbar: ['bold', 'italic', 'underline', 'hyperlink']

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

2 participants