Comments (12)
Check out this: https://codesandbox.io/s/react-editor-js-elilp
It seems it has something to do with the hidden attribute:
ReactDOM.render(
<div>
<div hidden={true}>
<ReactEditor />
</div>
<div>
<ReactEditor />
</div>
</div>,
document.getElementById("root")
);
from react-editor-js.
I thought maybe it's the <div id="editor-js" />
, but appears it isn't: https://codesandbox.io/s/react-typescript-te1ky
It appears there must be some instance-sharing going on.
from react-editor-js.
Sure, I'll try to write something up.
from react-editor-js.
Not sure if this in line with the overall code base, as I haven't looked at this project's code prior to fiddling with this, but here's one approach.
This adds a constructor to add a holderID property that gets populated wherever the hard-coded "editor-js" had appeared.
from react-editor-js.
@hasufell Hi! First of all, thanks for your interest! 😍
It's difficult to understand. can you reproduce on codesandbox or others?
from react-editor-js.
@hasufell Thanks!
I'll check it. sorry. (feel free to submit pr whenever you want)
from react-editor-js.
@hasufell Hi!
You may need to set different holder
property between editors. (Check Ref)
ex)
render() {
return (
<div>
<ReactEditorJs holder="holder">
<div id="holder" />
</ReactEditorJs>
<ReactEditorJs holder="holder2">
<div id="holder2" />
</ReactEditorJs>
</div>
);
}
Thanks!
from react-editor-js.
IMO, this should be done automatically and the ids be randomized by default. Only className
should be set to something like editor-js
.
from react-editor-js.
I don't think so.
by default, react-editor-js use div#holder.
However, in some cases, i think can use a different tag or id.
Thanks!
from react-editor-js.
I don't think so.
Why not? API-wise this is neither documented properly, nor intuitive, nor what you would expect from most react libraries.
from react-editor-js.
Thanks for your good opinion. on second thought, you are right.
I'll change id
to random value by default. (If you don't mind, feel free to submit pull request)
from react-editor-js.
resolved (#76)
from react-editor-js.
Related Issues (20)
- Chrome: [Violation] Added non-passive event listener... breaking onChange
- React Editor JS in his second version does not render i18n correctly HOT 1
- Can't write anything in editorjs and it comes 0 height HOT 6
- Property or signature expected. TS1131 HOT 1
- Weird symbols appear instead....
- Cannot assign to read only property 'current' of object '#<Object>' HOT 1
- Using multiple ReactEditorJS instances
- How to add a new tool? HOT 1
- Option to add subscript and superscript
- Error: element with ID «editorjs» is missing. Pass correct holder's ID. HOT 4
- Not working with React.StrictMode HOT 7
- Unable to toggle readonly on 2.1.0
- How to change side of the block adding panel?
- How to get stored value?
- expose `renderFromHTML` into the `EditorCore` interface
- Width issue HOT 1
- Render custom tools
- Compatibility issue with react-router-dom
- a
- Scroll top on focusing input element 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 react-editor-js.