This works fine if using only one editor on the page.
However, if using multiple editors, if one of them is removed, but others are still alive - those styles are still removed causing slight layout changes.
Thus I think there should be some sort of global counter that counts remaining alive instances and removes the styles only if there are no alive editors left.
How can we reproduce the bug on our side?
Create 2 react editors.
Perform react update that removes one of them.
Expected result: global styles are still present
Actual result <style data-tiptap-style> tag is removed from head.
Can you provide a CodeSandbox?
No response
What did you expect to happen?
Have global styles alive as long as any editor instance is running
Anything to add? (optional)
No response
Did you update your dependencies?
[X] Yes, I’ve updated my dependencies to use the latest version of all packages.
What’s the bug you are facing?
Global styles (https://github.com/ueberdosis/tiptap/blob/main/packages/core/src/style.ts) are added to
<head>
when editor is created and removed when editor is destroyed.This works fine if using only one editor on the page.
However, if using multiple editors, if one of them is removed, but others are still alive - those styles are still removed causing slight layout changes.
Thus I think there should be some sort of global counter that counts remaining alive instances and removes the styles only if there are no alive editors left.
How can we reproduce the bug on our side?
Create 2 react editors.
Perform react update that removes one of them.
Expected result: global styles are still present Actual result
<style data-tiptap-style>
tag is removed from head.Can you provide a CodeSandbox?
No response
What did you expect to happen?
Have global styles alive as long as any editor instance is running
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?