Giter VIP home page Giter VIP logo

Comments (12)

hasufell avatar hasufell commented on September 28, 2024 4

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.

hasufell avatar hasufell commented on September 28, 2024 2

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.

hasufell avatar hasufell commented on September 28, 2024 2

Sure, I'll try to write something up.

from react-editor-js.

jakekara avatar jakekara commented on September 28, 2024 1

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.

jakekara@122a032

from react-editor-js.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

@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.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

@hasufell Thanks!

I'll check it. sorry. (feel free to submit pr whenever you want)

from react-editor-js.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

@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.

hasufell avatar hasufell commented on September 28, 2024

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.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

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.

hasufell avatar hasufell commented on September 28, 2024

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.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

@hasufell

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.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

resolved (#76)

from react-editor-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.