udecode / plate

Rich-text editor with shadcn/ui

Home Page:https://platejs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I can't access latest value in onChange event when I use rc-form (controlled form)

holycrypto opened this issue · comments

Description

image

In rc-form controlled form's platejs editor, I tried to process the nodes which contains <img /> pasted from webpage.

So the "parseNodes" method will detect and convert all external image urls to my private oss links, if the node url is private oss url will be skipped.

Now everytime I edited content, parseNodes still got old image url (external url not my private oss url), what should I do to make onChange event that has latest value returned?

Now everytime I edited content, console printed:
image

Steps to Reproduce

Sandbox

Expected Behavior

Get latest value in onChange event everytime when I edited

Environment

  • slate: 0.102.0
  • slate-react: 0.102.0
  • browser: chrome/firefox/safari

Bounty

Click here to add a bounty via Algora.

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

I have used createImagePlugin:
image

It works when I pasted image file, but didn't work when pasted html content.