Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
holycrypto opened this issue Apr 2, 2024 · 1 comment
Labels
bug Something isn't working needs reproduction

Comments

@holycrypto
Copy link

holycrypto commented Apr 2, 2024

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
@holycrypto holycrypto added the bug Something isn't working label Apr 2, 2024
@holycrypto
Copy link
Author

I have used createImagePlugin:
image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs reproduction
Projects
None yet
Development

No branches or pull requests

2 participants