Comments (5)
Hi @komaldembla, @juanhurtado10
I've checked the issue and I noticed it is not related to the undo plugin.
Editor.js does not manage a line break as an empty block or an empty paragraph block then, the undo plugin just can't restore it because this is not even persisted into the history stack:
There are workarounds to solve this:
- Use ENTER+SHIFT to lines break, you would get:
- Use editorjs-break-line, If you need a breake-line component, editorjs-undo works perfectly with this plugin
But definitely, a root solution may be done on the editor.js core. Here are some references:
Best,
Juan Gaviria
from editorjs-undo.
Screen.Recording.2021-09-08.at.5.07.51.PM.mov
After researching, I found that the following config allows the Undo plugin to recover the empty blocks.
paragraph: {
class: Paragraph,
inlineToolbar: true,
config: {
preserveBlank: true,
},
},
...
from editorjs-undo.
Please find the list
Device, Browser, OS:
- Macbook Pro, Chrome (92.0.4515.107), MacOS Catalina
Editor.js version: 2.22.0
Plugins used with their versions:
editorjs/checklist
(1.3.0),editorjs/delimiter
(1.2.0),editorjs/header
(2.6.1)editorjs/link
(2.3.1)editorjs/list
(1.6.2)editorjs/paragraph
(2.8.0)editorjs/underline
(1.0.0)editorjs-text-color-plugin
(1.1.22)
from editorjs-undo.
@juanhurtado10 - Thank you so much! This works :)
from editorjs-undo.
Thanks for the quick response here @MrJuanGaviriaK! I'll check the workarounds.
from editorjs-undo.
Related Issues (20)
- Add workflow for automatic publishing in npm
- Security Policy violation SECURITY.md HOT 3
- Undo is ignored, when Copy-paste 2-3 paragraph from Wikipedia HOT 1
- Undo does not work in document with initial data HOT 2
- TypeError: can't access property "type", t[i] is undefined in Next.js HOT 3
- undo redo not working for underline and change case and redo not working for hyperlink HOT 6
- Shortcuts are not supported on other keyboard layouts HOT 1
- Add shortcut for Cmd + Shift + Z to redo HOT 3
- Uncaught TypeError: Cannot read properties of undefined (reading 'holder') HOT 3
- Bug when editorjs has set 'paragraph: false' HOT 3
- Save request in read-mode when using multiple editors HOT 1
- Can't undo the deleted block HOT 3
- Undo event handler to trigger undo or redo without keyboard event. HOT 2
- Undo/Redo on German Keyboard Layout not working HOT 1
- Redo action HOT 1
- How do I use api to trigger actions HOT 1
- Undo operation malfunctions when there are line breaks HOT 1
- Can't find variable: regeneratorRuntime HOT 1
- Random bug when undoing HOT 7
- undo functionality doesn't work when splitting text by pressing enter HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from editorjs-undo.