-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Bug]: Extension hooks sometimes called multiple times. #5548
Comments
Appreciate the report, unfortunately the way that this was implemented is rather poor & prone to this sort of a bug, I plan to rewrite this to use proper classes in v3. So, I don't want to spend time on addressing this long standing issue right now, if you want to fix it, I'd be happy to take a PR for it. You can add to the tests here: tiptap/tests/cypress/integration/core/extendExtensions.spec.ts Lines 1 to 441 in 07f4c03
|
I’m unsure of the original intention behind these codes. Changing them might disrupt other usages or custom workarounds. It's okay not to fix this; just exercise caution when using custom extensions. |
Affected Packages
core
Version(s)
2.6.4
Bug Description
This issue was originally discussed in #5136 and fixed by #5147
I have found a new case not covered by this PR:
Let's see the source code of
Extension.extend()
:Child copied Parent's config
onCreate
, theonCreate
hook will be called twice:Browser Used
Chrome
Code Example URL
No response
Expected Behavior
Extension/Node/Mark hooks not be called multiple times.
Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: