Comments (8)
If I will pass expected data directly as prop ( not waiting for response ) -- there is no issues at all.
from editor.js.
@neSpecc could you help, please?
1)
- onChange triggers with empty data however
current answer
is exists and it rewrites answer to be empty - even after some additional rerenders of component ( as soon as I get requested from BE data from props )
current answer
becomes correct again, but editor doesn't rerenders with correct answer ( data ) object
from editor.js.
<Editor
key={`editor-${section}-${item}`}
data={answer}
onChange={(data) => {
console.log('editor beforeOnChange answer', answer)
console.log('editor onChange', data)
setAnswer(data)
}}
editorblock={`editorjs-container-${section}-${item}`}
/>
why I don't see current answer
after onChange
as soon as I have setAnswer
which is the part of useState
?
from editor.js.
@altumsoftwareds would you test in it 2.29.0-rc.4
?
from editor.js.
I am not sure if this is related, I am getting the same "warning" when I put editor.save()
method inside the onChange
function. However It is fine when I trigger editor.save()
somewhere else
editor = new EditorJS({
holder : 'summary',
onChange: function(api, event) {
editor.save().then(console.log)
}
});
from editor.js.
@ls84 where to put editor.save()
else, for example?
from editor.js.
@ls84 where to put
editor.save()
else, for example?
I am guessing the problem of Block «paragraph» skipped because saved data is invalid
is caused by saving data before it's ready to be saved out. My solution was to bind editor.save()
to a button click action. Hope this helps
from editor.js.
It's because the Paragraph delays saving its data to element. And the save function makes data from its element.
(And the warning occurs when the element has empty body)
requestAnimationFrame
causes the problem.
There are two solutions.
- Override the Paragraph and remove 'requestAnimationFrame' logic.
- Save using
requestAnimationFrame
inside onChange. This will make the save is called after hydrate. (FIFO)
from editor.js.
Related Issues (20)
- Simplifying Tool Icon Customization
- The simple-image doesn't work HOT 2
- Convert the paragraph to list automatically when the user types 1. or -
- Header elements aren't aligned with the toolbar actions
- TypeError: Cannot read properties of undefined (reading 'length') HOT 1
- Support for <font> tag inside the paragraph block HOT 1
- Duplicate copied links in a nested list
- Issue when upgrading `@editorjs/inline-code` to `1.5.0`
- How do I know if a block was created by a pasting action or by a user's manual click? HOT 1
- Improve alignment on the left side of the editor HOT 1
- onChange event is triggered immediately on initialization HOT 12
- Strange behavior when accessing state value in onChange
- TypeError: Cannot read properties of undefined (reading 'isInternal') HOT 1
- Styling using only utility classes (like Tailwind)
- TypeError: Spread syntac requires ...iterable[Symbol.iterator] to be a function HOT 1
- Feature Request : Inline Block Tool HOT 1
- Hello, How to create a top toolbar? Thanks.
- renderFromHTML is not awaiting clear() method HOT 1
- Unable to Trigger onChange Event for Next Line in EditorJS Paragraph in React JS
- rawHTML code field isnt rendering the html in the field HOT 1
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 editor.js.