How to disable default paragraph tool #1897
Replies: 11 comments 7 replies
-
You can specify default Tool. From types/configs/editor-config.d.ts
|
Beta Was this translation helpful? Give feedback.
-
but after this the toolbar option is not available to select another tool/block, that's why want disable this permanently. |
Beta Was this translation helpful? Give feedback.
-
I use |
Beta Was this translation helpful? Give feedback.
-
Hi all, |
Beta Was this translation helpful? Give feedback.
-
I added defaultBlock but still text is showing in the toolbar is there a way to hide it ? |
Beta Was this translation helpful? Give feedback.
-
For those who come across this problem just set paragraph to false like this import MyCustomBlock from './plugins/MyCustomBlock'
new EditorJS({
holder: 'editorjs',
defaultBlock: 'customBlock'
tools: {
paragraph: false,
customBlock: MyCustomBlock
}
}) |
Beta Was this translation helpful? Give feedback.
-
Maybe it's a problem with your paragraph implementation. For me, I gave up
because there is no toolbar support for custom paragraphs.
A sábado, 30/12/2023, 4:28 da tarde, Kalila ***@***.***>
escreveu:
… This doesn't quite work, it throws an error about "readonly" mode not
being available on "paragraph: false".
—
Reply to this email directly, view it on GitHub
<#1897 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ3M5XTPV2OCSWAFNHJN2ELYMA6KZAVCNFSM5NHBNZD2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TOOJXHE2TINY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Facing issue when i false paragraph then I can't able to get block content complete component : export default function Editor({ useEffect(() => {
}, [initialContent]); const save = async () => { return ( <div id="editorjs" className="min-h-[50vh] min-w-[80%] border-[1px] rounded-md" style={{ border: "1px solid lightgray", padding: "20px" }} /> {loading ? "Loading..." : "Submit"} ); } |
Beta Was this translation helpful? Give feedback.
-
I think, instead of relying on the paragraph block in Editor.js, it should use an empty block as the default. |
Beta Was this translation helpful? Give feedback.
-
Solution for me was to define a custom tool:
and then replacing the default in the configuration:
|
Beta Was this translation helpful? Give feedback.
-
It looks like the paragraph tool appears in a list of core tools that are always added to the user-supplied list if the user doesn't explicitly override them as suggested above. The code that does this is here in Here's a yarn-patch compatible patch file that does the job on the ESM build that's shipped in version 2.30.8 on NPM. It's not an ideal solution but it's effective as a workaround for me at the moment: diff --git a/dist/editorjs.mjs b/dist/editorjs.mjs
index 5a44e08549f1547de8550e38f2914dfab8d657ec..e773c1a800e0a32d38ef22cd4b716fa99e47698d 100644
--- a/dist/editorjs.mjs
+++ b/dist/editorjs.mjs
@@ -10391,11 +10391,11 @@ class Wn extends E {
class: mo,
isInternal: !0
},
- paragraph: {
- class: fo,
- inlineToolbar: !0,
- isInternal: !0
- },
+ // paragraph: {
+ // class: fo,
+ // inlineToolbar: !0,
+ // isInternal: !0
+ // },
stub: {
class: jn,
isInternal: !0 There are a couple of ways around this if the authors are willing to accept them as a PR:
|
Beta Was this translation helpful? Give feedback.
-
The question.
How to disable default paragraph tool?
Beta Was this translation helpful? Give feedback.
All reactions