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

[Bug]: why change isNodeEmpty behavior on a patch version? #5415

Closed
1 task done
tdawn0-0 opened this issue Jul 30, 2024 · 7 comments · Fixed by #5451
Closed
1 task done

[Bug]: why change isNodeEmpty behavior on a patch version? #5415

tdawn0-0 opened this issue Jul 30, 2024 · 7 comments · Fixed by #5451
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@tdawn0-0
Copy link

Affected Packages

core

Version(s)

2.5.7

Bug Description

the helper function isNodeEmpty behavior is change on the 2.5.7.
this will cause the editor isEmpty return true when the editor is only contain a image content.
#5393

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

isNodeEmpty behavior as usual on 2.5.x.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@tdawn0-0 tdawn0-0 added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Jul 30, 2024
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Jul 30, 2024
@romansp
Copy link
Contributor

romansp commented Jul 30, 2024

Also noticed that due to this change placeholder is now displayed unexpectedly. For example, if paragraph consists of just mentions or emoji nodes the whole paragraph is now considered to be empty.

This is currently reproducible on templates.tiptap.dev.

@nperez0111
Copy link

Sorry this was an oversight in the test cases, surprisingly it is not easy to know what is considered "empty"

nperez0111 added a commit that referenced this issue Jul 30, 2024
@tdawn0-0
Copy link
Author

Sorry this was an oversight in the test cases, surprisingly it is not easy to know what is considered "empty"

I understand that this is not a simple task. just changing a fundamental function in a patch version should be approached with more caution.

@nperez0111
Copy link

I understand that this is not a simple task. just changing a fundamental function in a patch version should be approached with more caution.

Obviously I did not intend to change the behavior of it. Mistakes can happen. Please reconsider berating maintainers of free OSS software.

nperez0111 added a commit that referenced this issue Aug 1, 2024
@arendjantetteroo
Copy link
Contributor

arendjantetteroo commented Aug 1, 2024

We add our own components to the page, which tiptap now considers empty since version 2.5.7.
This caused it to sent empty page data to our backend, basically deleting all content of our customers on this page, leading to data loss for these customers.

How can i test the new version works correctly for our usecase?

For example, we define a custom file component:
{"type":"fileComponent","attrs":{"fileId":"id","filename":"Test filename"}}

https://tiptap.dev/docs/editor/extensions/custom-extensions/create-new#create-a-node
On that page there is no mention that you need to handle a isNodeEmtpy check for custom code.

@tdawn0-0
Copy link
Author

tdawn0-0 commented Aug 2, 2024

I understand that this is not a simple task. just changing a fundamental function in a patch version should be approached with more caution.

Obviously I did not intend to change the behavior of it. Mistakes can happen. Please reconsider berating maintainers of free OSS software.

I'm here to discuss a matter. Please accept my apologies if it appeared that I was criticizing you. However, the changes in question are not insignificant.

@nperez0111 nperez0111 mentioned this issue Aug 6, 2024
5 tasks
@github-project-automation github-project-automation bot moved this from Triage open to Done in Tiptap Aug 6, 2024
@nperez0111
Copy link

This is now released with v2.5.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Archived in project
4 participants