udecode / plate

A rich-text editor powered by AI
https://platejs.org
Other
12k stars 733 forks source link

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

Closed holycrypto closed 1 month ago

holycrypto commented 7 months ago

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

Bounty

Click here to add a bounty via Algora.

Funding

Fund with Polar

holycrypto commented 7 months ago

I have used createImagePlugin:

image

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