-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Can't insert text where the cursor is #138
Comments
Hey, to help you further, please reproduce the problems you experience in a codesandbox, and give me some steps to reproduce. Chances are, you've encountered some bugs, but I do need to reproduce them on my side to resolve them. Thank you, |
Hi @petyosi , Thank you very much for the prompt response. I might not be doing something right, but I'll try to be as explicit as possible and I'll also leave some comments in the code. What I'm trying to achieve is that I want to have my own dropdown button with values that represents "tags" and if I click anywhere in the editor and then select the tag, I expect the tag to be inserted where the cursor was. Also, I would like to be able to delete the code blocks after inserting them and saving them into the DB, but for whatever reason, sometimes it works, and sometimes it doesn't; but most of the time it doesn't. The codesandbox is this: https://codesandbox.io/p/sandbox/stoic-napier-232h24?file=%2Fsrc%2FApp.css%3A3%2C21 The code is inside App.tsx The issues are the following:
This is how it's being done with regards to the code block - And this is what happens further. c) Retrieved in the front end - It doesn't look different at all, but after this, I cannot delete the code block anymore. I managed to reproduce the error on the live demo on the editor's documentation page as well, but I'm not sure what caused it, because I can't do that anymore. UPDATE - I was able to reproduce it on the editor's documentation page, inside the live demo. Thanks again. |
Thanks for the reproduction instructions. I've traced down the problem to an erratic ref not being correctly passed by the code block editor. Will look for a solution, probably a button of some sort. It's a known issue with code mirror, unfortunately. As per the sandbox - I'm afraid that the direction you've taken is not going to work out. The proper way to extend the editor is with plugins that interact with the lexical API, including its selection mechanisms and node insertion/manipulation. I understand that this takes a bit more of an investment, as you need to understand how the plugins work (looking at their source code is actually not so scary), and you need to learn a bit of Lexical if you're not familiar with it, however, the model is robust and solves quite a few problems. |
Hi @petyosi , Thank you for your reply. I'll choose a different approach for the "Tags" then. However, I've found two more bugs in the documentation live demo:
|
Thanks for reporting those! I just pushed a fix for it. |
🎉 This issue has been resolved in version 1.4.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi,
I've got a few issues and I'm not sure what I'm doing wrong:
Uncaught Error: No CodeBlockEditor registered for language=null meta=null
at CodeBlockEditorContainer (CodeBlockNode.js:136:11)
at renderWithHooks (react-dom.development.js:16305:18)
at mountIndeterminateComponent (react-dom.development.js:20074:13)
at beginWork (react-dom.development.js:21587:16)
at beginWork$1 (react-dom.development.js:27426:14)
at performUnitOfWork (react-dom.development.js:26557:12)
at workLoopSync (react-dom.development.js:26466:5)
at renderRootSync (react-dom.development.js:26434:7)
at recoverFromConcurrentError (react-dom.development.js:25850:20)
at performSyncWorkOnRoot (react-dom.development.js:26096:20)
The text was updated successfully, but these errors were encountered: