-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
How to handle flicker on mount #2040
Comments
Having the same issue in React with |
I had to revert the last change. If you want to prevent that flicker you can use a custom |
just realized it not only flickers but actually completely resets itself, when I type the cursor moves back to the first position |
I can’t read the code on the screenshot, so without that it’s hard to say. :) |
Trying to debug several issues right now, my entire code is here: whenever adding a dependency to the useEditor hook the entire instance is destroyed which is not what I want |
Has anyone found at least a workaround for this issue? |
Only load the instance once, then you have to use internal methods to reset the content and any handlers you have passed, here you can see some code on how to reset the handlers: For the content there are other calls like That is the only way you will avoid flickers, trying to change them via the hook results in the internal editor instance being completely destroyed and re-mounted, so no way to use that without having flickers |
How do you load the instance only once? p.s. Sorry if this is common knowledge, I'm new to this lib :) |
Just want to say that I used a custom hook that Phillip suggested and UI flicker is gone now. Edited it a bit to suit my case, but essentially it worked. Thanks! |
@Miloshinjo Would you mind sharing your edited version and explain your changes? Maybe it can be useful to others :) |
hello, it's this gist https://gist.github.com/ryanto/4a431d822a98770c4ca7905d9b7b07da, but I just removed 2 calls to Also the option I'm using on the editor is |
@Miloshinjo Thank you 👍 |
…s#2282), fix ueberdosis#2040, fix ueberdosis#2182" This reverts commit 2436e2c.
This is driving me crazy, is there really no fix coming for this? I have a very simple use case, an editor with the Collaboration extension, and I cannot switch documents without a jarring flicker. |
This issue seemingly should not be closed. |
What’s the bug you are facing?
Hi! We are working to integrate TipTap into our app & are pretty early in the process. Thanks for the hard work on the lib.
When first rendering the editor, we notice that there is a period of time where nothing is rendered. Taking the CodeSandbox (also linked below), I can toggle the editor & see that when the editor is meant to be shown, the first render cycle is empty.
Is this expected? Can it be fixed?
Before toggle
After toggle
Editor now visible ("test")
How can we reproduce the bug on our side?
I was using the Chrome devtools Performance tab to record the behavior and capture screenshots.
Can you provide a CodeSandbox?
https://codesandbox.io/s/brave-thunder-7h41n?file=/src/App.js
What did you expect to happen?
I would expect there to be a way to avoid this flicker situation & have the editor visible on mount, but perhaps I am missing something in my setup?
Anything to add? (optional)
I am using the React lib &
useEditor
.Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: