Git Product home page Git Product logo

Comments (4)

12joan avatar 12joan commented on June 2, 2024

It looks like code blocks are intermittently broken on Plate's docs site, both on the full playground and on the basic marks page. If you refresh multiple times, sometimes it will render correctly; other times it will be broken.

Broken:
image

Expected:
image

from plate.

Ashiria7 avatar Ashiria7 commented on June 2, 2024

@12joan Do you have any idea about this bug? I watch the CodeBlockElement component render, it seems like run correctly, but the dom exactly is wrong. I'm trying to find out what cause the problem, but I have no idea until now :(

from plate.

12joan avatar 12joan commented on June 2, 2024

@AXiLiYa Sorry, I'm not sure what's causing this. I'm not seeing it when running the dev server locally, so it might be specific to Next.js's production environment.

from plate.

Ashiria7 avatar Ashiria7 commented on June 2, 2024

@12joan That's really strange. I have cloned the souce code and run dev (I have checked out main branch). In the page, the problem appeared almost erverytime when I refresh browser.
image
I also use plate in a client render project after package it(I'm using v22 version). The problem also exists when I pass the initialValue. But when I change the way of setting value may like this (if I dont't make mistake)

function MyEditor() {
  const editor = useRef()

  function updateValue(value) {
    editor.current.children = value
    editor.current.onChange()
  }
  
  useEffect(() => {
    setTimeout(() => updateValue(someValueWithCode), 100)
  }, [])

  // without using intialValue
  return <Plate ref={editor} />
}

It can work properly.

from plate.

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.