-
Notifications
You must be signed in to change notification settings - Fork 47
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
Unable to use half of the mui-tiptap controls #174
Comments
Hopefully help avoid confusing errors like the ones seen here #174
@sgober In order to use extensions with Tiptap, you have to (1) install the packages you need (e.g. So rather than just including const editor = useEditor({
extensions: [StarterKit, Color, Underline], // And all others you want to include!
content: data,
onUpdate({ editor }) {
handleChange(path, editor.getHTML());
}
}); For instance, in the demo example in mui-tiptap (essentially the same as what's in the CodeSandbox linked from the README), you can check out the full list of extensions it uses here: mui-tiptap/src/demo/Editor.tsx Lines 33 to 35 in 02e4706
mui-tiptap/src/demo/Editor.tsx Line 143 in 02e4706
mui-tiptap/src/demo/useExtensions.ts Lines 84 to 188 in 02e4706
Apologies that this wasn't clearer in the README. I've updated the Choosing your extensions section to hopefully help folks avoid these sorts of confusing errors in the future. |
Also, would it be possible to add a aria-label to the inputs like font family and font size? There currently is one, but it's not on the input so there is a missing label error from an accessibility standpoint |
@sgober Glad to hear that! The mui-tiptap/src/controls/MenuSelectTextAlign.tsx Lines 190 to 195 in ddb43ab
So for instance, if your cursor/caret is currently inside a code block (not one of the Try adding some text and highlighting it in your example. |
Unfortunately still no luck... Screen.Recording.2023-10-30.at.3.29.14.PM.mov |
I've added a new issue to track that here #175. The |
Hm, I'm not sure what's going on. Can you create a CodeSandbox that reproduces the problem? I can definitely take a look that way. Please create a new issue for that if so! Or can you tell what you're doing differently compared to the CodeSandbox linked from the mui-tiptap README? |
I'm having a ton of issues with code sandbox at the moment where I can't even load yours to be able to for it. This is essentially what I have and matches what you're doing in the code sandbox, but this is essentially what I have. It's used within json forms you, you might have to ignore some
It very much seems like I could be missing something small in the setup. All of the tiptap extensions are version 2.1.12 |
@sgober Thanks, I was able to copy that locally (and remove the jsonforms stuff) and reproduce the above issue with tl;dr: It seems this can be fixed by changing I didn't realize this was the behavior until testing your example. But if there are any "unknown" types in that list, the Let me know if that resolves the problem on your end! |
@sjdemartini this did the trick, THANK YOU! I appreciate you taking the time to figure out what was wrong. One other quick question for you, I'm seeing the indent/unindent buttons disabled (if you comment the the |
@sgober Great! The indent and unindent actions/buttons are specifically for lists (bullet, number, task). Also note that you can only indent something if there is a list item above it that is part of the same list and is at the same indentation level as it. You could also look at Tiptap's demo here to see the behavior: https://tiptap.dev/api/nodes/bullet-list. Hope that helps. |
Got it - doesn't fully serve my purposes so will probably leave it out for now. Thanks again for all your help! |
Since it's common to get questions/"issues" pertaining to this and is important to help diagnose as well. e.g. #187, #174, #136 (comment)
Since it's common to get questions/"issues" pertaining to this and is important to help diagnose as well. e.g. #187, #174, #136 (comment)
Describe the bug
I am unable to use like half of the
mui-tiptap
components as they fail with errors likesetColor
ortoggleUnderline
are not functions (see screenshot below)To Reproduce
Steps to reproduce the behavior:
This is what I am trying to use with json forms:
With editor defined as follows:
Expected behavior
Every
mui-tiptap
component above that is commented out results in an error similar to the one I described above. It is odd that some of them work and some of them don'tScreenshots
What is able to work:
Error when I try to use
MenuButtonUnderline
:All other error are similar, not sure if this is a
tiptap
error or something specific tomui-tiptap
System (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: