-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Editor is being rendered with setTimeout (async) #3345
Comments
having this issue too. has there been a fix for this? |
Not yet. Feel free to find a solution for this - I'll try to find some time to take a quick look into it next week but I don't think there will be a quick fix since I suspect Prosemirror rendering the content after processing the input and updating the state + view which will always delay the first render. I'm not 100% sure how What exactly changes with react-window when you enter a new line into your editor by the way? Wouldn't this cause errors since the height of the dom element would change after react-window calculates the virtualization heights? |
It's a problem in certain scenarios. We have a scenario where we need to render comments in a list (using |
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days |
bump |
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days |
I might try a crack at this. We're coming across the same issue with virtual scrolling libraries reliant on the height of the element being defined at mount if possible. |
This could be reopened. It is still relevant issue. |
bump |
What’s the bug you are facing?
The Editor is being rendered asynchronously. Here on this line, the initialization is set after timeout (which makes it asynchronous).
tiptap/packages/core/src/Editor.ts
Line 98 in 4851fc5
This makes it hard to use TipTap with other libraries that work with
clientHeight
(e.g. react-window).Which browser was this experienced in? Are any special extensions installed?
All browsers.
How can we reproduce the bug on our side?
Yes, please see attached codesandbox.
Can you provide a CodeSandbox?
Here's a codesandbox demo demonstrating the problem - there is height calculated immediately after rendering and one after 1ms timeout.
https://codesandbox.io/s/cranky-feather-9tf083?file=/src/App.js
What did you expect to happen?
I would expect that TipTap is initialized and rendered synchronously.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: