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

fix(react): reset initialized when editorcontent is unmounting #3781

Merged
merged 3 commits into from Feb 27, 2023

Conversation

bdbch
Copy link
Contributor

@bdbch bdbch commented Feb 23, 2023

This PR should resolve the flushSync issues (see #3331, #3580, #3764) and pr #3533

From my local tests I didn't receive any error messages nor did my cursor stay in the old position after inserting a new React NodeView with an editor content.

closes #3331
closes #3580
closes #3764

@bdbch bdbch self-assigned this Feb 23, 2023
@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit 69db322
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/63fcf77f46c3c70008a4df00
😎 Deploy Preview https://deploy-preview-3781--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

svenadlung
svenadlung previously approved these changes Feb 26, 2023
jamesopti
jamesopti previously approved these changes Feb 27, 2023
Copy link

@jamesopti jamesopti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this as well and it appears to work well.

packages/react/src/EditorContent.tsx Outdated Show resolved Hide resolved
@bdbch bdbch dismissed stale reviews from jamesopti and svenadlung via 880ac5d February 27, 2023 18:32
@bdbch bdbch merged commit 38b7e41 into main Feb 27, 2023
@bdbch bdbch deleted the fix/react-flushsync branch February 27, 2023 18:33
@KentoMoriwaki
Copy link
Contributor

I think this PR doesn't completely resolve this issue #3331 which is reproduced by #3533
Here's a CodeSandbox that demonstrates the problem.

Could you please consider an alternative approach that doesn't use queueMicrotask during normal updates?

@KentoMoriwaki
Copy link
Contributor

I opened a PR about this.
#3862

aliasliao pushed a commit to aliasliao/tiptap that referenced this pull request May 24, 2023
…dosis#3781)

* fix(react): reset initialized when editorcontent is unmounting

* style: remove unneeded if statement
andrewlu0 pushed a commit to trybaseplate/tiptap that referenced this pull request Oct 20, 2023
…dosis#3781)

* fix(react): reset initialized when editorcontent is unmounting

* style: remove unneeded if statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants