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

Ignore iOS mutations when unfocused #2170

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

thatsjonsense
Copy link
Contributor

We're running into a weird bug where NodeViews get stuck an infinite loop of mounting and unmounting when they contain an iframe. This causes a React maximum update depth exceeded crash, and also causes the content of some of those nodeviews to be wiped out.

To reproduce, try visiting https://9hgxv.csb.app/ on an iPhone. The same code works fine on a desktop.

We believe the issue is related to the default ignoreMutation method, which returns false when contenteditable nodes are added on iOS. I don't understand all the context of this function, but we found that patching this function to add a check for this.editor.isFocused (to narrow the if statement to only apply when triggered by the user's keyboard) fixed it in our fork.

We previously raised this issue in #1971 but thought it was fixed. It turns out it was only partially fixed. Instead of happening with all nodeviews in iOS, it now only seems to happen in the narrower case when the iframe is present. But the fix described in #1971 still works.

Related issues: #1214, ProseMirror/prosemirror#1162 (comment)

@netlify
Copy link

netlify bot commented Nov 17, 2021

✔️ Deploy Preview for tiptap-embed ready!

🔨 Explore the source changes: a08389d

🔍 Inspect the deploy log: https://app.netlify.com/sites/tiptap-embed/deploys/6194aae18c4a4c0007ccc336

😎 Browse the preview: https://deploy-preview-2170--tiptap-embed.netlify.app

@philippkuehn
Copy link
Contributor

iOS safari is extremely buggy so let’s try this! thank you!

@philippkuehn philippkuehn merged commit 10fea3b into ueberdosis:main Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants